From 6696fc363ddd14245a8d3b03e806e48703d1b23f Mon Sep 17 00:00:00 2001 From: alandonovan Date: Fri, 20 Oct 2017 10:55:17 -0400 Subject: syntax: make 'load' a reserved word (#31) * syntax: make 'load' a reserved word --- resolve/testdata/resolve.sky | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'resolve') diff --git a/resolve/testdata/resolve.sky b/resolve/testdata/resolve.sky index c48af1c..f8c4c9a 100644 --- a/resolve/testdata/resolve.sky +++ b/resolve/testdata/resolve.sky @@ -120,6 +120,7 @@ def f(): f() --- +load("module", "name") # ok def f(): load("foo", "bar") ### "load statement within a function" @@ -131,24 +132,6 @@ load("foo", c="_d", ### "load: names with leading underscores are not exported: _d" _e="f") # ok ---- -# A load() call as an expression statement is converted into a -# load statement, but load is not currently a reserved word. -# TODO(adonovan): clarify the Skylark spec on this issue. - -def load(): # doesn't affect following call - pass - -_ = 1 + load() # ok - -load("foo.sky", "") ### "load: empty identifier" - ---- - -def f(load): - _ = (load, load()) # ok - load("foo.sky", "x") ### "load statement within a function" - --- # return, if statements and for loops at top-level are forbidden -- cgit v1.2.3