feat(tvix/eval): implement scope poisoning for true/false/null
These tokens are optionally parsed as identifiers by Nix, which means that within any scopes that resolve them the compiler needs to track whether they have been overridden to know whether to emit the literal instructions or resolve a variable. This is implemented by a new concept of "scope poisoning", where the compiler's scope structure tracks whether or not any builtin identifiers have been overridden. Change-Id: I3ab711146e229f843f6e1f0343385382ee0aecb6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6227 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: grfn <grfn@gws.fyi>
This commit is contained in:
parent
0b51d63081
commit
0f739cd944
5 changed files with 60 additions and 5 deletions
|
|
@ -0,0 +1 @@
|
|||
[ 1 2 3 ]
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
let
|
||||
true = 1;
|
||||
false = 2;
|
||||
null = 3;
|
||||
in
|
||||
[ true false null ]
|
||||
|
|
@ -0,0 +1 @@
|
|||
[ true false null 1 2 3 ]
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
let
|
||||
poisoned = let
|
||||
true = 1;
|
||||
false = 2;
|
||||
null = 3;
|
||||
in [ true false null ];
|
||||
in [ true false null ] ++ poisoned
|
||||
Loading…
Add table
Add a link
Reference in a new issue