|
|
@@ -117,9 +117,6 @@ func (l *Lexer) NextToken() token.Token {
|
|
|
tok = newToken(token.LBRACE, l.ch)
|
|
|
case '}':
|
|
|
tok = newToken(token.RBRACE, l.ch)
|
|
|
- case 0:
|
|
|
- tok.Type = token.EOF
|
|
|
- tok.Literal = ""
|
|
|
case '"':
|
|
|
tok.Type = token.STRING
|
|
|
tok.Literal = l.readString()
|
|
|
@@ -127,6 +124,11 @@ func (l *Lexer) NextToken() token.Token {
|
|
|
tok = newToken(token.LBRACKET, l.ch)
|
|
|
case ']':
|
|
|
tok = newToken(token.RBRACKET, l.ch)
|
|
|
+ case ':':
|
|
|
+ tok = newToken(token.COLON, l.ch)
|
|
|
+ case 0:
|
|
|
+ tok.Type = token.EOF
|
|
|
+ tok.Literal = ""
|
|
|
default:
|
|
|
if isLetter(l.ch) {
|
|
|
tok.Literal = l.readIdentifier()
|