diff --git a/ex.moon b/ex.moon index 7acb064..2d11bc2 100644 --- a/ex.moon +++ b/ex.moon @@ -30,10 +30,8 @@ other_hash: { key_4: ["five" 6 7.8] } -item_one: "this is item one" - # we may reference an item that was defined earlier -item_two: item_one +repeat_hash: hash # items can be hidden. i.e., they're only valid in the parse and eval stage as # intermediate values internal to the config file; they are *not* visible to diff --git a/main.go b/main.go index e5fba19..9810eef 100644 --- a/main.go +++ b/main.go @@ -6,6 +6,7 @@ import ( "fmt" "io" "os" + "strings" ) func input(n int) io.ReadCloser { @@ -63,6 +64,11 @@ func eval(r io.Reader) (map[string]interface{}, error) { if _, err := n.eval(ctx); err != nil { return nil, fmt.Errorf("eval error: %s\n", err) } + for name, _ := range ctx { + if strings.HasPrefix(name, ".") { + delete(ctx, name) + } + } return ctx, nil }