lang: funcs: core: Make module names public

This is needed for when we have nested modules.
This commit is contained in:
James Shubin
2019-05-20 08:45:43 -04:00
parent d5074871c7
commit 12582e963d
35 changed files with 49 additions and 49 deletions

View File

@@ -18,6 +18,6 @@
package coredatetime
const (
// moduleName is the prefix given to all the functions in this module.
moduleName = "datetime"
// ModuleName is the prefix given to all the functions in this module.
ModuleName = "datetime"
)

View File

@@ -25,7 +25,7 @@ import (
)
func init() {
facts.ModuleRegister(moduleName, "now", func() facts.Fact { return &DateTimeFact{} }) // must register the fact and name
facts.ModuleRegister(ModuleName, "now", func() facts.Fact { return &DateTimeFact{} }) // must register the fact and name
}
// DateTimeFact is a fact which returns the current date and time.

View File

@@ -27,7 +27,7 @@ import (
func init() {
// FIXME: consider renaming this to printf, and add in a format string?
simple.ModuleRegister(moduleName, "print", &types.FuncValue{
simple.ModuleRegister(ModuleName, "print", &types.FuncValue{
T: types.NewType("func(a int) str"),
V: func(input []types.Value) (types.Value, error) {
epochDelta := input[0].Int()

View File

@@ -27,7 +27,7 @@ import (
)
func init() {
simple.ModuleRegister(moduleName, "weekday", &types.FuncValue{
simple.ModuleRegister(ModuleName, "weekday", &types.FuncValue{
T: types.NewType("func(a int) str"),
V: Weekday,
})