Added a comma token
This commit is contained in:
parent
608162fa92
commit
8b28fe5a4c
@ -179,6 +179,11 @@ func (lexer *LexingOperation) tokenizeSymbolBeginning () (err error) {
|
||||
token.kind = TokenKindDot
|
||||
lexer.addToken(token)
|
||||
err = lexer.nextRune()
|
||||
case ',':
|
||||
token := lexer.newToken()
|
||||
token.kind = TokenKindComma
|
||||
lexer.addToken(token)
|
||||
err = lexer.nextRune()
|
||||
case '[':
|
||||
token := lexer.newToken()
|
||||
token.kind = TokenKindLBracket
|
||||
|
@ -62,6 +62,7 @@ func TestTokenizeAll (test *testing.T) {
|
||||
Token { kind: TokenKindName, value: "helloWorld" },
|
||||
Token { kind: TokenKindColon },
|
||||
Token { kind: TokenKindDot },
|
||||
Token { kind: TokenKindComma },
|
||||
Token { kind: TokenKindLBracket },
|
||||
Token { kind: TokenKindRBracket },
|
||||
Token { kind: TokenKindLBrace },
|
||||
|
@ -24,6 +24,7 @@ const (
|
||||
|
||||
TokenKindColon
|
||||
TokenKindDot
|
||||
TokenKindComma
|
||||
|
||||
TokenKindLBracket
|
||||
TokenKindRBracket
|
||||
@ -133,6 +134,8 @@ func (tokenKind TokenKind) Describe () (description string) {
|
||||
description = "Colon"
|
||||
case TokenKindDot:
|
||||
description = "Dot"
|
||||
case TokenKindComma:
|
||||
description = "Comma"
|
||||
case TokenKindLBracket:
|
||||
description = "LBracket"
|
||||
case TokenKindRBracket:
|
||||
|
@ -1,3 +1,3 @@
|
||||
:arf
|
||||
--- rw -> -349820394 932748397 239485.37520 "hello world!\n" 'E' helloWorld:.[]{}
|
||||
--- rw -> -349820394 932748397 239485.37520 "hello world!\n" 'E' helloWorld:.,[]{}
|
||||
+ - ++ -- * / @ ! % ~ < << > >> | || & &&
|
||||
|
Reference in New Issue
Block a user