From c003fdf2182432a25892467bf1a456049f4b1c1d Mon Sep 17 00:00:00 2001 From: Silvan Jegen Date: Sun, 15 Jan 2017 20:04:53 +0100 Subject: Implement Stringer interface for the token type --- conf/scanner.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'conf/scanner.go') 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 -- cgit v1.2.1-18-gbd029