From d6d493fc569ce5e8925843da213cea249ce34aae Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Tue, 16 Aug 2016 13:33:29 -0700 Subject: cmd/compile/internal/syntax: add a Line method to interface Node Change-Id: I64baf334a35c72336d26fa6755c67eb9d6f4e93c --- src/cmd/compile/internal/syntax/nodes.go | 5 +++++ 1 file changed, 5 insertions(+) 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) -- cgit v1.2.3-54-g00ecf