aboutsummaryrefslogtreecommitdiff
path: root/syntax/syntax.go
diff options
context:
space:
mode:
authoralandonovan <adonovan@google.com>2018-03-02 10:20:44 -0500
committerGitHub <noreply@github.com>2018-03-02 10:20:44 -0500
commitab191a020b346a426f0ad3c540ff23bddbe0b1b0 (patch)
tree66e8928eacda130d0cd45af486a2572b3f2c5250 /syntax/syntax.go
parent11b496306ff83d01ad34c57ed772f22ef69d8a75 (diff)
downloadstarlark-go-ab191a020b346a426f0ad3c540ff23bddbe0b1b0.tar.gz
syntax: add (*LoadStmt).ModuleName accessor method, for convenience (#76)
Diffstat (limited to 'syntax/syntax.go')
-rw-r--r--syntax/syntax.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/syntax/syntax.go b/syntax/syntax.go
index ba5e730..3440b64 100644
--- a/syntax/syntax.go
+++ b/syntax/syntax.go
@@ -199,6 +199,9 @@ func (x *LoadStmt) Span() (start, end Position) {
return x.Load, x.Rparen
}
+// ModuleName returns the name of the module loaded by this statement.
+func (x *LoadStmt) ModuleName() string { return x.Module.Value.(string) }
+
// A BranchStmt changes the flow of control: break, continue, pass.
type BranchStmt struct {
commentsRef