about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libexpr/parser.y1
-rw-r--r--tests/lang/eval-okay-empty-args.exp1
-rw-r--r--tests/lang/eval-okay-empty-args.nix1
3 files changed, 3 insertions, 0 deletions
diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y
index 3540058bc1e0..1c06240fdab0 100644
--- a/src/libexpr/parser.y
+++ b/src/libexpr/parser.y
@@ -249,6 +249,7 @@ expr_list
 formals
   : formal ',' formals { $$ = ATinsert($3, $1); } /* idem - right recursive */
   | formal { $$ = ATinsert(ATempty, $1); }
+  | { $$ = ATempty; }
   ;
 
 formal
diff --git a/tests/lang/eval-okay-empty-args.exp b/tests/lang/eval-okay-empty-args.exp
new file mode 100644
index 000000000000..c386bbc80410
--- /dev/null
+++ b/tests/lang/eval-okay-empty-args.exp
@@ -0,0 +1 @@
+Str("ab",[])
diff --git a/tests/lang/eval-okay-empty-args.nix b/tests/lang/eval-okay-empty-args.nix
new file mode 100644
index 000000000000..78c133afdd94
--- /dev/null
+++ b/tests/lang/eval-okay-empty-args.nix
@@ -0,0 +1 @@
+({}: {x,y,}: "${x}${y}") {} {x = "a"; y = "b";}