Skip to content

Commit

Permalink
#508 : working on multi-value return
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksey Rakov committed Apr 12, 2023
1 parent b64323d commit 10e28d0
Show file tree
Hide file tree
Showing 11 changed files with 356 additions and 245 deletions.
34 changes: 24 additions & 10 deletions dat/sg/syntax60.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ __define constant 12301;
__define long 12302;
__define real 12303;

__define SUB_DECLARATION 4097;
__define DECLARATION 5120;
__define BLOCK 7184;
__define NO_BODY 7185;
Expand All @@ -28,6 +29,7 @@ __define NESTED 4224;
__define CLOSURE 4225;
__define MESSAGE 4288;
__define OPERATOR 4310;
__define SUB_VARIABLE 4311;
__define RET_EXPRESSION 7220;
__define GET_EXPRESSION 7222;
__define INIT_EXPRESSION 7223;
Expand All @@ -48,16 +50,16 @@ __define LOOP_OPERATION 6221;
__define ELSE_OPERATION 6222;
__define IF_ELSE_OPERATION 6223;
__define MUL_OPERATION 6224;
__define DIV_OPERATION 6225;
__define NOTLESS_OPERATION 6226;
__define GREATER_OPERATION 6227;
__define NOTGREATER_OPERATION 6228;
__define EXTERN_OPERATION 6229;
__define NEGATE_OPERATION 6230;
__define VALUE_OPERATION 6231;
__define BAND_OPERATION 6232;
__define BOR_OPERATION 6233;
__define BXOR_OPERATION 6234;
__define DIV_OPERATION 6225;
__define NOTLESS_OPERATION 6226;
__define GREATER_OPERATION 6227;
__define NOTGREATER_OPERATION 6228;
__define EXTERN_OPERATION 6229;
__define NEGATE_OPERATION 6230;
__define VALUE_OPERATION 6231;
__define BAND_OPERATION 6232;
__define BOR_OPERATION 6233;
__define BXOR_OPERATION 6234;
__define BNOT_OPERATION 6235;
__define SHL_OPERATION 6236;
__define SHR_OPERATION 6237;
Expand All @@ -69,6 +71,7 @@ __define OR_OPERATION 6242;
__define XOR_OPERATION 6243;
__define BREAK_OPERATION 6244;
__define LAZY_OPERATION 6245;
__define TUPLE_ASSIGNING 6246;
__define MESSAGE_OPERATION 6337;
__define PROPERTY_OPERATION 6340;
__define EXPRESSION 6288;
Expand Down Expand Up @@ -119,10 +122,14 @@ DECLARATION ::=

IR_DECLARATION ::=
{ TEMPLATE_BRACKETS identifier? | { DYNAMIC_DIMENSION ^ARRAY_TYPE }+ identifier } { POSTFIXES NESTED_SCOPE | SCOPE }
| { "," SUB_DECLARATION }+ { POSTFIXES NESTED_SCOPE | SCOPE }
| "::" COMPLEX_NAME TEMPLATE_BRACKETS? METHOD_SCOPE
| POSTFIXES NESTED_SCOPE
| SCOPE;

SUB_DECLARATION ::=
{ identifier | reference }+ { TEMPLATE_BRACKETS identifier? | { DYNAMIC_DIMENSION ^ARRAY_TYPE }+ identifier | eps };

DICTIONARY ::=
identifier+;

Expand Down Expand Up @@ -224,6 +231,7 @@ ROOT_EXPRESSION ::=
| ASSIGN EXPRESSION ^PROPERTY_OPERATION
| eps ^PROPERTY_OPERATION }
| eps ^OBJECT }
| "," ^OBJECT SUB_VARIABLE { "," SUB_VARIABLE }* ASSIGN EXPRESSION ^TUPLE_ASSIGNING
| reference {
L3 ^OBJECT MESSAGE L3_R
| eps ^OBJECT }
Expand Down Expand Up @@ -776,6 +784,12 @@ PARAMETER ::=
| TEMPLATE_BRACKETS identifier
| eps };

SUB_VARIABLE ::=
identifier+ {
DYNAMIC_DIMENSION ^ARRAY_TYPE identifier
| TEMPLATE_BRACKETS identifier
| eps };

MESSAGE ::=
identifier;

Expand Down
Loading

0 comments on commit 10e28d0

Please sign in to comment.