aboutsummaryrefslogtreecommitdiff
path: root/spec/lexer.go
diff options
context:
space:
mode:
authorRyo Nihei <nihei.dev@gmail.com>2022-03-28 01:30:49 +0900
committerRyo Nihei <nihei.dev@gmail.com>2022-03-28 01:45:11 +0900
commit1746609e248151d575f6e3913ad5023fd421bfff (patch)
tree9312ac986191b3798125e2d3cc41518601d9b9e2 /spec/lexer.go
parentFollow golangci-lint (diff)
downloadcotia-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.go6
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:])