1
0
Fork 0

Single-character tokens printing fix

This commit is contained in:
Gregory Eremin 2015-02-18 00:49:12 +07:00
parent 6bcd7fd2e7
commit 3d17f23e65
1 changed files with 2 additions and 14 deletions

View File

@ -278,24 +278,12 @@ func lexString(l *Lexer) stateFn {
func (i Item) String() string {
var label string
switch i.Token {
case BraceOpen, BraceClose, BracketOpen, BracketClose, Quote, Colon, Comma:
label = i.Val
case EOF:
label = "EOF"
case Error:
label = fmt.Sprintf("(Error: %q)", i.Val)
case BraceOpen:
label = "{"
case BraceClose:
label = "}"
case BracketOpen:
label = "["
case BracketClose:
label = "]"
case Quote:
label = "\""
case Colon:
label = ":"
case Comma:
label = ","
case Null:
label = fmt.Sprintf("(NULL: %q)", i.Val)
case Bool: