diff options
author | Ryo Nihei <nihei.dev@gmail.com> | 2021-06-20 23:47:29 +0900 |
---|---|---|
committer | Ryo Nihei <nihei.dev@gmail.com> | 2021-06-20 23:47:29 +0900 |
commit | 8ab850528e1c05f36668f36db6af4cdcb647180e (patch) | |
tree | cf1e373ebd76c6ad78d65c79351b2198c7e42b2a /spec/lexer.go | |
parent | Add skip action (diff) | |
download | urubu-8ab850528e1c05f36668f36db6af4cdcb647180e.tar.gz urubu-8ab850528e1c05f36668f36db6af4cdcb647180e.tar.xz |
Add syntax of fragment
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 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": |