From 1746609e248151d575f6e3913ad5023fd421bfff Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Mon, 28 Mar 2022 01:30:49 +0900 Subject: Simplify the syntax of #ast directive This change allows using the simple syntax of the directive like `#ast $1 $3...` instead of `#ast #(foo $1 $3...)`. --- spec/lexer.go | 6 ------ 1 file changed, 6 deletions(-) (limited to 'spec/lexer.go') diff --git a/spec/lexer.go b/spec/lexer.go index ba64925..d1cb67d 100644 --- a/spec/lexer.go +++ b/spec/lexer.go @@ -24,8 +24,6 @@ const ( tokenKindOr = tokenKind("|") tokenKindSemicolon = tokenKind(";") tokenKindDirectiveMarker = tokenKind("#") - tokenKindTreeNodeOpen = tokenKind("#(") - tokenKindTreeNodeClose = tokenKind(")") tokenKindPosition = tokenKind("$") tokenKindExpantion = tokenKind("...") tokenKindMetaDataMarker = tokenKind("%") @@ -273,10 +271,6 @@ func (l *lexer) lexAndSkipWSs() (*token, error) { return newSymbolToken(tokenKindSemicolon, newPosition(tok.Row+1, tok.Col+1)), nil case KindIDDirectiveMarker: return newSymbolToken(tokenKindDirectiveMarker, newPosition(tok.Row+1, tok.Col+1)), nil - case KindIDTreeNodeOpen: - return newSymbolToken(tokenKindTreeNodeOpen, newPosition(tok.Row+1, tok.Col+1)), nil - case KindIDTreeNodeClose: - return newSymbolToken(tokenKindTreeNodeClose, newPosition(tok.Row+1, tok.Col+1)), nil case KindIDPosition: // Remove '$' character and convert to an integer. num, err := strconv.Atoi(string(tok.Lexeme)[1:]) -- cgit v1.2.3