mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 00:08:07 +02:00
Merge branch 'pr/Mewp/5577'
This commit is contained in:
commit
0dc764c309
4 changed files with 18 additions and 0 deletions
|
@ -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
|
||||
;
|
||||
|
||||
|
|
6
tests/lang/eval-fail-function-apply-dollar.nix
Normal file
6
tests/lang/eval-fail-function-apply-dollar.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
let
|
||||
a = 5;
|
||||
b = 1;
|
||||
|
||||
add = a: b: a + b;
|
||||
in add a $ a $ b
|
1
tests/lang/eval-okay-function-apply-dollar.exp
Normal file
1
tests/lang/eval-okay-function-apply-dollar.exp
Normal file
|
@ -0,0 +1 @@
|
|||
18
|
9
tests/lang/eval-okay-function-apply-dollar.nix
Normal file
9
tests/lang/eval-okay-function-apply-dollar.nix
Normal 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
|
Loading…
Reference in a new issue