selectors support for hash
This commit is contained in:
@@ -107,6 +107,8 @@ func (l *Lexer) NextToken() token.Token {
|
||||
tok = newToken(token.SEMICOLON, l.ch)
|
||||
case ',':
|
||||
tok = newToken(token.COMMA, l.ch)
|
||||
case '.':
|
||||
tok = newToken(token.DOT, l.ch)
|
||||
case '(':
|
||||
tok = newToken(token.LPAREN, l.ch)
|
||||
case ')':
|
||||
|
||||
@@ -32,7 +32,7 @@ func TestNextToken(t *testing.T) {
|
||||
"foo bar"
|
||||
[1, 2];
|
||||
{"foo": "bar"}
|
||||
"foo \"bar\""
|
||||
d.foo
|
||||
`
|
||||
|
||||
tests := []struct {
|
||||
@@ -138,7 +138,9 @@ func TestNextToken(t *testing.T) {
|
||||
{token.COLON, ":"},
|
||||
{token.STRING, "bar"},
|
||||
{token.RBRACE, "}"},
|
||||
{token.STRING, "foo \"bar\""},
|
||||
{token.IDENT, "d"},
|
||||
{token.DOT, "."},
|
||||
{token.IDENT, "foo"},
|
||||
{token.EOF, ""},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user