diff options
author | Ryo Nihei <nihei.dev@gmail.com> | 2022-03-28 22:31:30 +0900 |
---|---|---|
committer | Ryo Nihei <nihei.dev@gmail.com> | 2022-03-29 01:45:05 +0900 |
commit | ed43562cf58e8c0f9390421848879308fdfc60cb (patch) | |
tree | 16beff7d233b95ae53d2c8019bc47be378f304b8 /spec/lexer.go | |
parent | Simplify the syntax of #ast directive (diff) | |
download | urubu-ed43562cf58e8c0f9390421848879308fdfc60cb.tar.gz urubu-ed43562cf58e8c0f9390421848879308fdfc60cb.tar.xz |
Add label notation
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 d1cb67d..51791be 100644 --- a/spec/lexer.go +++ b/spec/lexer.go @@ -23,6 +23,7 @@ const ( tokenKindColon = tokenKind(":") tokenKindOr = tokenKind("|") tokenKindSemicolon = tokenKind(";") + tokenKindLabelMarker = tokenKind("@") tokenKindDirectiveMarker = tokenKind("#") tokenKindPosition = tokenKind("$") tokenKindExpantion = tokenKind("...") @@ -269,6 +270,8 @@ func (l *lexer) lexAndSkipWSs() (*token, error) { return newSymbolToken(tokenKindOr, newPosition(tok.Row+1, tok.Col+1)), nil case KindIDSemicolon: return newSymbolToken(tokenKindSemicolon, newPosition(tok.Row+1, tok.Col+1)), nil + case KindIDLabelMarker: + return newSymbolToken(tokenKindLabelMarker, newPosition(tok.Row+1, tok.Col+1)), nil case KindIDDirectiveMarker: return newSymbolToken(tokenKindDirectiveMarker, newPosition(tok.Row+1, tok.Col+1)), nil case KindIDPosition: |