The code for serialization Expr nodes back into (pseudo-)Nix has been removed for being subtly error-prone and tedious to maintain. Instead, `nix-instantiate --parse` now prints a JSON representation of the AST. Usage patterns of the --parse flag I've found in the wild: 1. Check if a file is well-formed, i.e. discard output and test exit code 2. Get parser errors from a file, i.e. discard stdout and use stderr 3. Nixfmt uses --parse to test equivalence pre/post format, and that property is (should be?) preserved None of these should break with the current change Closes #487 Change-Id: Icdbaad17790f2ad8765fa08e02e6597ee4c7a909
30 lines
399 B
Plaintext
30 lines
399 B
Plaintext
_type: ExprLet
|
|
attrs:
|
|
b:
|
|
_type: ExprInt
|
|
value: 2
|
|
c:
|
|
_type: ExprSet
|
|
recursive: false
|
|
body:
|
|
_type: ExprSet
|
|
attrs:
|
|
a:
|
|
_type: ExprInt
|
|
value: 1
|
|
f:
|
|
_type: ExprInt
|
|
value: 3
|
|
inherit:
|
|
b:
|
|
_type: ExprVar
|
|
value: b
|
|
inheritFrom:
|
|
- attrs:
|
|
- d
|
|
- e
|
|
from:
|
|
_type: ExprVar
|
|
value: c
|
|
recursive: false
|