In lexer, always prefer the longest match
Only use rules' precedence to decide between two tokens that match the same string
This commit is contained in:
parent
c85841364e
commit
77df7fe511
5 changed files with 252 additions and 43 deletions
|
|
@ -81,3 +81,11 @@ var thing = {
|
|||
(comment)
|
||||
(expression_statement (function_call (identifier)))))))))
|
||||
|
||||
==========================================
|
||||
parses comments within expressions
|
||||
==========================================
|
||||
y // comment
|
||||
* z;
|
||||
---
|
||||
(program
|
||||
(expression_statement (math_op (expression (identifier) (comment)) (identifier))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue