diff options
Diffstat (limited to 'src/MoonP/moon_ast.h')
-rw-r--r-- | src/MoonP/moon_ast.h | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/src/MoonP/moon_ast.h b/src/MoonP/moon_ast.h index 4918a0a..42522dd 100644 --- a/src/MoonP/moon_ast.h +++ b/src/MoonP/moon_ast.h | |||
@@ -341,8 +341,8 @@ AST_END(Update) | |||
341 | AST_LEAF(BinaryOperator) | 341 | AST_LEAF(BinaryOperator) |
342 | AST_END(BinaryOperator) | 342 | AST_END(BinaryOperator) |
343 | 343 | ||
344 | AST_LEAF(BackcallOperator) | 344 | AST_LEAF(unary_operator) |
345 | AST_END(BackcallOperator) | 345 | AST_END(unary_operator) |
346 | 346 | ||
347 | class AssignableChain_t; | 347 | class AssignableChain_t; |
348 | 348 | ||
@@ -351,18 +351,19 @@ AST_NODE(Assignable) | |||
351 | AST_MEMBER(Assignable, &item) | 351 | AST_MEMBER(Assignable, &item) |
352 | AST_END(Assignable) | 352 | AST_END(Assignable) |
353 | 353 | ||
354 | class Value_t; | 354 | class unary_exp_t; |
355 | 355 | ||
356 | AST_NODE(exp_op_value) | 356 | AST_NODE(exp_op_value) |
357 | ast_sel<true, BinaryOperator_t, BackcallOperator_t> op; | 357 | ast_ptr<true, BinaryOperator_t> op; |
358 | ast_ptr<true, Value_t> value; | 358 | ast_list<true, unary_exp_t> backcalls; |
359 | AST_MEMBER(exp_op_value, &op, &value) | 359 | AST_MEMBER(exp_op_value, &op, &backcalls) |
360 | AST_END(exp_op_value) | 360 | AST_END(exp_op_value) |
361 | 361 | ||
362 | AST_NODE(Exp) | 362 | AST_NODE(Exp) |
363 | ast_ptr<true, Value_t> value; | 363 | ast_ptr<true, Seperator_t> sep; |
364 | ast_list<true, unary_exp_t> backcalls; | ||
364 | ast_list<false, exp_op_value_t> opValues; | 365 | ast_list<false, exp_op_value_t> opValues; |
365 | AST_MEMBER(Exp, &value, &opValues) | 366 | AST_MEMBER(Exp, &sep, &backcalls, &opValues) |
366 | AST_END(Exp) | 367 | AST_END(Exp) |
367 | 368 | ||
368 | class Parens_t; | 369 | class Parens_t; |
@@ -396,14 +397,15 @@ AST_END(simple_table) | |||
396 | class String_t; | 397 | class String_t; |
397 | class const_value_t; | 398 | class const_value_t; |
398 | class ClassDecl_t; | 399 | class ClassDecl_t; |
399 | class unary_exp_t; | 400 | class unary_value_t; |
400 | class TableLit_t; | 401 | class TableLit_t; |
401 | class FunLit_t; | 402 | class FunLit_t; |
402 | 403 | ||
403 | AST_NODE(SimpleValue) | 404 | AST_NODE(SimpleValue) |
404 | ast_sel<true, const_value_t, | 405 | ast_sel<true, const_value_t, |
405 | If_t, Unless_t, Switch_t, With_t, ClassDecl_t, | 406 | If_t, Unless_t, Switch_t, With_t, ClassDecl_t, |
406 | ForEach_t, For_t, While_t, Do_t, unary_exp_t, | 407 | ForEach_t, For_t, While_t, Do_t, |
408 | unary_value_t, | ||
407 | TblComprehension_t, TableLit_t, Comprehension_t, | 409 | TblComprehension_t, TableLit_t, Comprehension_t, |
408 | FunLit_t, Num_t> value; | 410 | FunLit_t, Num_t> value; |
409 | AST_MEMBER(SimpleValue, &value) | 411 | AST_MEMBER(SimpleValue, &value) |
@@ -641,9 +643,16 @@ AST_END(InvokeArgs) | |||
641 | AST_LEAF(const_value) | 643 | AST_LEAF(const_value) |
642 | AST_END(const_value) | 644 | AST_END(const_value) |
643 | 645 | ||
646 | AST_NODE(unary_value) | ||
647 | ast_list<true, unary_operator_t> ops; | ||
648 | ast_ptr<true, Value_t> value; | ||
649 | AST_MEMBER(unary_value, &ops, &value) | ||
650 | AST_END(unary_value) | ||
651 | |||
644 | AST_NODE(unary_exp) | 652 | AST_NODE(unary_exp) |
645 | ast_ptr<true, Exp_t> item; | 653 | ast_list<false, unary_operator_t> ops; |
646 | AST_MEMBER(unary_exp, &item) | 654 | ast_list<true, Value_t> expos; |
655 | AST_MEMBER(unary_exp, &ops, &expos) | ||
647 | AST_END(unary_exp) | 656 | AST_END(unary_exp) |
648 | 657 | ||
649 | AST_NODE(ExpListAssign) | 658 | AST_NODE(ExpListAssign) |