Add for-in loops and math assignment operators to js grammar
This commit is contained in:
parent
f4287c07d0
commit
1c7d2d2d03
6 changed files with 59121 additions and 49463 deletions
|
|
@ -13,12 +13,12 @@ parses constructor calls
|
|||
var x = new Node(5, new Node(3, null));
|
||||
---
|
||||
(program (var_declaration
|
||||
(assignment (identifier)
|
||||
(identifier)
|
||||
(constructor_call (function_call (identifier)
|
||||
(number)
|
||||
(constructor_call (function_call (identifier)
|
||||
(number)
|
||||
(constructor_call (function_call (identifier)
|
||||
(number)
|
||||
(null))))))))
|
||||
(null)))))))
|
||||
|
||||
==========================================
|
||||
parses property access with dot notation
|
||||
|
|
@ -116,6 +116,20 @@ print(x in y)
|
|||
(identifier)
|
||||
(in_expression (identifier) (identifier)))))
|
||||
|
||||
============================================
|
||||
parses assignment operators
|
||||
============================================
|
||||
x += 1;
|
||||
x -= 1;
|
||||
x *= 2;
|
||||
x /= 2;
|
||||
---
|
||||
(program
|
||||
(expression_statement (assignment (identifier) (number)))
|
||||
(expression_statement (assignment (identifier) (number)))
|
||||
(expression_statement (assignment (identifier) (number)))
|
||||
(expression_statement (assignment (identifier) (number))))
|
||||
|
||||
============================================
|
||||
parses property access and operators
|
||||
============================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue