summaryrefslogtreecommitdiff
path: root/src/pkg/go/token/token.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2009-07-14 10:44:57 -0700
committerRobert Griesemer <gri@golang.org>2009-07-14 10:44:57 -0700
commitb5318dcac20f5c1302975995b35f9883cf173cb0 (patch)
tree958b37c128124281cf2faae1191a55e15db02124 /src/pkg/go/token/token.go
parentaf68bb2b309c186a519201f4c3bbcc339fdd064a (diff)
downloadgolang-b5318dcac20f5c1302975995b35f9883cf173cb0.tar.gz
- added Filename field to token.Position
- handle //line filename:line comments in scanner - moved error handling code used by various scanner clients to errors.go - added extra tests R=rsc DELTA=385 (343 added, 18 deleted, 24 changed) OCL=31551 CL=31601
Diffstat (limited to 'src/pkg/go/token/token.go')
-rw-r--r--src/pkg/go/token/token.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pkg/go/token/token.go b/src/pkg/go/token/token.go
index a70a75a54..3197b6637 100644
--- a/src/pkg/go/token/token.go
+++ b/src/pkg/go/token/token.go
@@ -327,6 +327,7 @@ func (tok Token) IsKeyword() bool {
// A Position is valid if the line number is > 0.
//
type Position struct {
+ Filename string; // filename, if any
Offset int; // byte offset, starting at 0
Line int; // line number, starting at 1
Column int; // column number, starting at 1 (character count)