forked from lix-project/lix
* Allow empty argument lists in function definitions (e.g., `{}:
bla'). Also allow trailing commas (`{x, y,}: ...') as a unintented consequence. Hopefully the reduce/reduce conflict won't cause any problems.
This commit is contained in:
parent
7046c35843
commit
ca00aa1171
|
@ -249,6 +249,7 @@ expr_list
|
||||||
formals
|
formals
|
||||||
: formal ',' formals { $$ = ATinsert($3, $1); } /* idem - right recursive */
|
: formal ',' formals { $$ = ATinsert($3, $1); } /* idem - right recursive */
|
||||||
| formal { $$ = ATinsert(ATempty, $1); }
|
| formal { $$ = ATinsert(ATempty, $1); }
|
||||||
|
| { $$ = ATempty; }
|
||||||
;
|
;
|
||||||
|
|
||||||
formal
|
formal
|
||||||
|
|
1
tests/lang/eval-okay-empty-args.exp
Normal file
1
tests/lang/eval-okay-empty-args.exp
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Str("ab",[])
|
1
tests/lang/eval-okay-empty-args.nix
Normal file
1
tests/lang/eval-okay-empty-args.nix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
({}: {x,y,}: "${x}${y}") {} {x = "a"; y = "b";}
|
Loading…
Reference in a new issue