|
|
|
@ -15,7 +15,8 @@ module.exports = compiler.grammar
|
|
|
|
@if_statement,
|
|
|
|
@if_statement,
|
|
|
|
@for_statement,
|
|
|
|
@for_statement,
|
|
|
|
@statement_block,
|
|
|
|
@statement_block,
|
|
|
|
@return_statement)
|
|
|
|
@return_statement,
|
|
|
|
|
|
|
|
@var_declaration)
|
|
|
|
|
|
|
|
|
|
|
|
expression_statement: -> seq(
|
|
|
|
expression_statement: -> seq(
|
|
|
|
optional(@expression), ";")
|
|
|
|
optional(@expression), ";")
|
|
|
|
@ -39,6 +40,16 @@ module.exports = compiler.grammar
|
|
|
|
optional(@expression),
|
|
|
|
optional(@expression),
|
|
|
|
";")
|
|
|
|
";")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var_declaration: -> seq(
|
|
|
|
|
|
|
|
keyword("var"),
|
|
|
|
|
|
|
|
commaSep(choice(
|
|
|
|
|
|
|
|
@identifier,
|
|
|
|
|
|
|
|
seq(
|
|
|
|
|
|
|
|
@identifier,
|
|
|
|
|
|
|
|
"=",
|
|
|
|
|
|
|
|
@expression))),
|
|
|
|
|
|
|
|
";")
|
|
|
|
|
|
|
|
|
|
|
|
expression: -> choice(
|
|
|
|
expression: -> choice(
|
|
|
|
@identifier,
|
|
|
|
@identifier,
|
|
|
|
@number,
|
|
|
|
@number,
|
|
|
|
|