Merge branch 'pr/Mewp/5577'

This commit is contained in:
Max Headroom 2022-02-21 23:06:08 +01:00
commit 0dc764c309
4 changed files with 18 additions and 0 deletions

View file

@ -346,6 +346,7 @@ void yyerror(YYLTYPE * loc, yyscan_t scanner, ParseData * data, const char * err
%token IND_STRING_OPEN IND_STRING_CLOSE
%token ELLIPSIS
%right '$'
%right IMPL
%left OR
%left AND
@ -420,6 +421,7 @@ expr_op
| expr_op '*' expr_op { $$ = new ExprCall(CUR_POS, new ExprVar(data->symbols.create("__mul")), {$1, $3}); }
| expr_op '/' expr_op { $$ = new ExprCall(CUR_POS, new ExprVar(data->symbols.create("__div")), {$1, $3}); }
| expr_op CONCAT expr_op { $$ = new ExprOpConcatLists(CUR_POS, $1, $3); }
| expr_op '$' expr_op { $$ = new ExprCall(CUR_POS, $1, {$3}); }
| expr_app
;

View file

@ -0,0 +1,6 @@
let
a = 5;
b = 1;
add = a: b: a + b;
in add a $ a $ b

View file

@ -0,0 +1 @@
18

View file

@ -0,0 +1,9 @@
let
a = 5;
b = 1;
c = 2;
concat = a: b: "${a}${b}";
nested.attr.ab = 10;
add = a: b: a + b;
in add nested.attr.${concat "a" "b"} $ add b $ add a c