diff options
author | Ryo Nihei <nihei.dev@gmail.com> | 2021-06-15 19:44:51 +0900 |
---|---|---|
committer | Ryo Nihei <nihei.dev@gmail.com> | 2021-06-15 19:44:51 +0900 |
commit | 434ee1561016d0fd5099c755b150365b7a528c6b (patch) | |
tree | 682b822a8b30df0bcab5e132068232dce88360a4 /spec/lexer.go | |
parent | Add spec parser (diff) | |
download | cotia-434ee1561016d0fd5099c755b150365b7a528c6b.tar.gz cotia-434ee1561016d0fd5099c755b150365b7a528c6b.tar.xz |
Add production syntax
Diffstat (limited to 'spec/lexer.go')
-rw-r--r-- | spec/lexer.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/spec/lexer.go b/spec/lexer.go index 54eb13a..943cbf9 100644 --- a/spec/lexer.go +++ b/spec/lexer.go @@ -19,6 +19,7 @@ const ( tokenKindID = tokenKind("id") tokenKindTerminalPattern = tokenKind("terminal pattern") tokenKindColon = tokenKind(":") + tokenKindOr = tokenKind("|") tokenKindSemicolon = tokenKind(";") tokenKindEOF = tokenKind("eof") tokenKindInvalid = tokenKind("invalid") @@ -128,6 +129,8 @@ func (l *lexer) next() (*token, error) { } case "colon": return newSymbolToken(tokenKindColon), nil + case "or": + return newSymbolToken(tokenKindOr), nil case "semicolon": return newSymbolToken(tokenKindSemicolon), nil default: |