mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 05:56:15 +02:00
* 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
3 changed files with 3 additions and 0 deletions
|
@ -249,6 +249,7 @@ expr_list
|
|||
formals
|
||||
: formal ',' formals { $$ = ATinsert($3, $1); } /* idem - right recursive */
|
||||
| formal { $$ = ATinsert(ATempty, $1); }
|
||||
| { $$ = ATempty; }
|
||||
;
|
||||
|
||||
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