aboutsummaryrefslogtreecommitdiff
path: root/cmd/starlark
diff options
context:
space:
mode:
authorAlan Donovan <adonovan@google.com>2018-12-18 13:09:56 -0500
committerAlan Donovan <adonovan@google.com>2018-12-18 13:14:55 -0500
commitc0b6b768d91b2b919fd75c060b95f91ecb3b6d8a (patch)
tree7ffbee4938700855cc4fae3ee2d97114b976daf4 /cmd/starlark
parent88085a499633e675c9b29c3ff8ea2073480047a5 (diff)
downloadstarlark-go-c0b6b768d91b2b919fd75c060b95f91ecb3b6d8a.tar.gz
starlark: permit if/for/while at toplevel if -globalreassign
Also: - make the option handling work the same across all tests - be explicit about which options are needed in each test chunk - improve documentation of options - rename fp option to float consistently - rename global_reassign option to globalreassign consistently Fixes #36 Change-Id: I8fdf5725ce47c2f4a87aac9d5c24583e503d0f74
Diffstat (limited to 'cmd/starlark')
-rw-r--r--cmd/starlark/starlark.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd/starlark/starlark.go b/cmd/starlark/starlark.go
index 46dc598..d5d7103 100644
--- a/cmd/starlark/starlark.go
+++ b/cmd/starlark/starlark.go
@@ -29,12 +29,13 @@ var (
// non-standard dialect flags
func init() {
- flag.BoolVar(&resolve.AllowFloat, "fp", resolve.AllowFloat, "allow floating-point numbers")
+ flag.BoolVar(&resolve.AllowFloat, "float", resolve.AllowFloat, "allow floating-point numbers")
flag.BoolVar(&resolve.AllowSet, "set", resolve.AllowSet, "allow set data type")
flag.BoolVar(&resolve.AllowLambda, "lambda", resolve.AllowLambda, "allow lambda expressions")
flag.BoolVar(&resolve.AllowNestedDef, "nesteddef", resolve.AllowNestedDef, "allow nested def statements")
flag.BoolVar(&resolve.AllowBitwise, "bitwise", resolve.AllowBitwise, "allow bitwise operations (&, |, ^, ~, <<, and >>)")
flag.BoolVar(&resolve.AllowRecursion, "recursion", resolve.AllowRecursion, "allow while statements and recursive functions")
+ flag.BoolVar(&resolve.AllowGlobalReassign, "globalreassign", resolve.AllowGlobalReassign, "allow reassignment of globals, and if/for/while statements at top level")
}
func main() {