aboutsummaryrefslogtreecommitdiff
path: root/resolve
diff options
context:
space:
mode:
authoralandonovan <adonovan@google.com>2017-10-20 10:55:17 -0400
committerGitHub <noreply@github.com>2017-10-20 10:55:17 -0400
commit6696fc363ddd14245a8d3b03e806e48703d1b23f (patch)
treee883c301d6dd8d35f74beea7abb0e1d1ca4385d7 /resolve
parent4cbd89655273776a2cc65b02514f98b68df5b27e (diff)
downloadstarlark-go-6696fc363ddd14245a8d3b03e806e48703d1b23f.tar.gz
syntax: make 'load' a reserved word (#31)
* syntax: make 'load' a reserved word
Diffstat (limited to 'resolve')
-rw-r--r--resolve/testdata/resolve.sky19
1 files changed, 1 insertions, 18 deletions
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"
@@ -132,24 +133,6 @@ load("foo",
_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
for x in "abc": ### "for loop not within a function"