From 8ab850528e1c05f36668f36db6af4cdcb647180e Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Sun, 20 Jun 2021 23:47:29 +0900 Subject: Add syntax of fragment --- 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 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": -- cgit v1.2.3