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
|
|
@ -22,21 +22,6 @@ theFunction('', "", 'single-quoted-string', "double-quoted-string");
|
|||
(program (expression_statement (function_call (identifier)
|
||||
(string) (string) (string) (string))))
|
||||
|
||||
==========================================
|
||||
parses multiple statements
|
||||
==========================================
|
||||
var x = {}, z, i = 0;
|
||||
firstFunction(x)
|
||||
secondFunction(x);
|
||||
---
|
||||
(program
|
||||
(var_declaration
|
||||
(assignment (identifier) (object))
|
||||
(identifier)
|
||||
(assignment (identifier) (number)))
|
||||
(expression_statement (function_call (identifier) (identifier)))
|
||||
(expression_statement (function_call (identifier) (identifier))))
|
||||
|
||||
==========================================
|
||||
parses function expressions
|
||||
==========================================
|
||||
|
|
@ -47,11 +32,11 @@ var x = {
|
|||
};
|
||||
---
|
||||
(program
|
||||
(var_declaration (assignment
|
||||
(var_declaration
|
||||
(identifier)
|
||||
(object (identifier) (function_expression
|
||||
(formal_parameters (identifier) (identifier))
|
||||
(statement_block (var_declaration (assignment (identifier) (identifier)))))))))
|
||||
(statement_block (var_declaration (identifier) (identifier)))))))
|
||||
|
||||
==========================================
|
||||
parses comments
|
||||
|
|
@ -72,14 +57,14 @@ var thing = {
|
|||
(program
|
||||
(comment)
|
||||
(comment)
|
||||
(var_declaration (assignment (identifier) (object
|
||||
(var_declaration (identifier) (object
|
||||
(comment)
|
||||
(comment)
|
||||
(identifier) (function_expression
|
||||
(formal_parameters (identifier) (comment))
|
||||
(statement_block
|
||||
(comment)
|
||||
(expression_statement (function_call (identifier)))))))))
|
||||
(expression_statement (function_call (identifier))))))))
|
||||
|
||||
==========================================
|
||||
parses comments within expressions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue