diff options
author | Matthew Dempsky <mdempsky@google.com> | 2016-08-16 13:33:29 -0700 |
---|---|---|
committer | Matthew Dempsky <mdempsky@google.com> | 2016-08-16 14:32:09 -0700 |
commit | d6d493fc569ce5e8925843da213cea249ce34aae (patch) | |
tree | 0219d6ca0ad39698ba8de175d1fbe5a5ca9c745a | |
parent | 4bc85b2eb8664470c131517d9fab1090827857b6 (diff) | |
download | go-d6d493fc569ce5e8925843da213cea249ce34aae.tar.gz go-d6d493fc569ce5e8925843da213cea249ce34aae.zip |
cmd/compile/internal/syntax: add a Line method to interface Node
Change-Id: I64baf334a35c72336d26fa6755c67eb9d6f4e93c
-rw-r--r-- | src/cmd/compile/internal/syntax/nodes.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/syntax/nodes.go b/src/cmd/compile/internal/syntax/nodes.go index 4e264c1e82..fee155c97c 100644 --- a/src/cmd/compile/internal/syntax/nodes.go +++ b/src/cmd/compile/internal/syntax/nodes.go @@ -8,6 +8,7 @@ package syntax // Nodes type Node interface { + Line() uint32 aNode() } @@ -19,6 +20,10 @@ type node struct { func (*node) aNode() {} +func (n *node) Line() uint32 { + return n.line +} + func (n *node) init(p *parser) { n.pos = uint32(p.pos) n.line = uint32(p.line) |