From 434ee1561016d0fd5099c755b150365b7a528c6b Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Tue, 15 Jun 2021 19:44:51 +0900 Subject: Add production syntax --- spec/lexer.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'spec/lexer.go') 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: -- cgit v1.2.3