aboutsummaryrefslogtreecommitdiff
path: root/spec/lexer.go
diff options
context:
space:
mode:
authorRyo Nihei <nihei.dev@gmail.com>2021-06-20 23:47:29 +0900
committerRyo Nihei <nihei.dev@gmail.com>2021-06-20 23:47:29 +0900
commit8ab850528e1c05f36668f36db6af4cdcb647180e (patch)
treecf1e373ebd76c6ad78d65c79351b2198c7e42b2a /spec/lexer.go
parentAdd skip action (diff)
downloadcotia-8ab850528e1c05f36668f36db6af4cdcb647180e.tar.gz
cotia-8ab850528e1c05f36668f36db6af4cdcb647180e.tar.xz
Add syntax of fragment
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 18aae51..a8e46ad 100644
--- a/spec/lexer.go
+++ b/spec/lexer.go
@@ -16,6 +16,7 @@ import (
type tokenKind string
const (
+ tokenKindKWFragment = tokenKind("fragment")
tokenKindID = tokenKind("id")
tokenKindTerminalPattern = tokenKind("terminal pattern")
tokenKindColon = tokenKind(":")
@@ -109,6 +110,8 @@ func (l *lexer) next() (*token, error) {
continue
case "line_comment":
continue
+ case "kw_fragment":
+ return newSymbolToken(tokenKindKWFragment), nil
case "identifier":
return newIDToken(tok.Text()), nil
case "terminal_open":