aboutsummaryrefslogtreecommitdiff
path: root/spec/lexer.go
diff options
context:
space:
mode:
authorRyo Nihei <nihei.dev@gmail.com>2021-06-15 19:44:51 +0900
committerRyo Nihei <nihei.dev@gmail.com>2021-06-15 19:44:51 +0900
commit434ee1561016d0fd5099c755b150365b7a528c6b (patch)
tree682b822a8b30df0bcab5e132068232dce88360a4 /spec/lexer.go
parentAdd spec parser (diff)
downloadcotia-434ee1561016d0fd5099c755b150365b7a528c6b.tar.gz
cotia-434ee1561016d0fd5099c755b150365b7a528c6b.tar.xz
Add production syntax
Diffstat (limited to 'spec/lexer.go')
-rw-r--r--spec/lexer.go3
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: