attr path parser: fix bug in not rejecting empty attr paths, add unparser

The following behaviour was previously present and has been fixed:

lix/lix2 » nix eval --expr '{x."" = 2;}' 'x.""'
{ "" = 2; }
lix/lix2 » nix eval --expr '{x."".y = 2;}' 'x."".y'
error: empty attribute name in selection path 'x."".y'

Change-Id: Iad21988f1191c33a3661c72a6b7f01a8b8b3e6eb
This commit is contained in:
Jade Lovelace
2024-12-10 13:32:28 -08:00
parent 2a9e560570
commit 21ad02c1d0
8 changed files with 122 additions and 16 deletions
+4 -1
View File
@@ -8,7 +8,6 @@
#include "lix/libexpr/nixexpr.hh"
#include "lix/libexpr/eval.hh"
#include "lix/libexpr/eval-inline.hh"
#include "lix/libstore/store-api.hh"
#include "tests/libstore.hh"
@@ -20,6 +19,10 @@ namespace nix {
initLibExpr();
}
EvalState & evalState() {
return state;
}
protected:
LibExprTest()
: LibStoreTest()