diff options
author | Ryo Nihei <nihei.dev@gmail.com> | 2021-08-22 15:39:27 +0900 |
---|---|---|
committer | Ryo Nihei <nihei.dev@gmail.com> | 2021-08-22 15:44:03 +0900 |
commit | 4d879b95d5368d578a39baaefba0de743a764105 (patch) | |
tree | a0e78f5c9916405545f1e7b139f9427b1cd190cc /spec/lexer.go | |
parent | Resolve conflicts by default rules (diff) | |
download | cotia-4d879b95d5368d578a39baaefba0de743a764105.tar.gz cotia-4d879b95d5368d578a39baaefba0de743a764105.tar.xz |
Support %left and %right to specify precedences and associativities
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 30757c6..da0cf74 100644 --- a/spec/lexer.go +++ b/spec/lexer.go @@ -29,6 +29,7 @@ const ( tokenKindTreeNodeClose = tokenKind(")") tokenKindPosition = tokenKind("$") tokenKindExpantion = tokenKind("...") + tokenKindMetaDataMarker = tokenKind("%") tokenKindNewline = tokenKind("newline") tokenKindEOF = tokenKind("eof") tokenKindInvalid = tokenKind("invalid") @@ -258,6 +259,8 @@ func (l *lexer) lexAndSkipWSs() (*token, error) { return newPositionToken(num, newPosition(l.row)), nil case "expansion": return newSymbolToken(tokenKindExpantion, newPosition(l.row)), nil + case "metadata_marker": + return newSymbolToken(tokenKindMetaDataMarker, newPosition(l.row)), nil default: return newInvalidToken(tok.Text(), newPosition(l.row)), nil } |