From ed43562cf58e8c0f9390421848879308fdfc60cb Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Mon, 28 Mar 2022 22:31:30 +0900 Subject: Add label notation --- 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 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: -- cgit v1.2.3