diff options
author | Silvan Jegen <s.jegen@gmail.com> | 2017-01-15 20:04:53 +0100 |
---|---|---|
committer | Silvan Jegen <s.jegen@gmail.com> | 2017-01-15 20:04:53 +0100 |
commit | c003fdf2182432a25892467bf1a456049f4b1c1d (patch) | |
tree | 540b5719ba61a409a5b50a0b051d15d1e8228ba9 /conf/scanner.go | |
parent | 7ae918084e0a38041565d28b904515dc7695e66b (diff) |
Implement Stringer interface for the token type
Diffstat (limited to 'conf/scanner.go')
-rw-r--r-- | conf/scanner.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/conf/scanner.go b/conf/scanner.go index 9bd7a4b..54546aa 100644 --- a/conf/scanner.go +++ b/conf/scanner.go @@ -20,6 +20,14 @@ const ( IfStatement ) +var tokentypestrings []string = []string{Name: "Name", Literal: "Literal", + DeliOpen: "Opening delimiter", DeliClose: "Closing delimiter", + Nothing: "Nothing", IfStatement: "If statement"} + +func (tt tokentype) String() string { + return tokentypestrings[tt] +} + type token struct { Type tokentype Offset int |