diff options
author | Ryo Nihei <nihei.dev@gmail.com> | 2022-03-28 01:30:49 +0900 |
---|---|---|
committer | Ryo Nihei <nihei.dev@gmail.com> | 2022-03-28 01:45:11 +0900 |
commit | 1746609e248151d575f6e3913ad5023fd421bfff (patch) | |
tree | 9312ac986191b3798125e2d3cc41518601d9b9e2 /spec/lexer.go | |
parent | Follow golangci-lint (diff) | |
download | cotia-1746609e248151d575f6e3913ad5023fd421bfff.tar.gz cotia-1746609e248151d575f6e3913ad5023fd421bfff.tar.xz |
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...)`.
Diffstat (limited to 'spec/lexer.go')
-rw-r--r-- | spec/lexer.go | 6 |
1 files changed, 0 insertions, 6 deletions
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:]) |