This website requires JavaScript.
Explore
Help
Sign In
nordic-dev.net
/
nix
Watch
2
Star
0
Fork
0
You've already forked nix
mirror of
https://github.com/NixOS/nix.git
synced
2025-02-16 17:02:28 +00:00
Code
Issues
Packages
Projects
Releases
Wiki
Activity
master
nix
/
tests
/
functional
/
lang
/
eval-okay-redefine-builtin.nix
5 lines
69 B
Nix
Raw
Permalink
Normal View
History
Unescape
Escape
Add the ExprBuiltin Expr type to the AST Certain desugaring schemes may require the parser to use some builtin function to do some of the work (e.g. currently `throw` is used to lazily cause an error if a `<>`-style path is not in the search path) Unfortunately, these names are not reserved keywords, so an expression that uses such a syntactic sugar will not see the expected behavior (see tests/lang/eval-okay-redefine-builtin.nix for an example). This adds the ExprBuiltin AST type, which when evaluated uses the value from the rootmost variable scope (which of course is initialized internally and can't shadow any of the builtins). Signed-off-by: Shea Levy <shea@shealevy.com>
2013-09-13 20:55:33 +00:00
let
throw
=
abort
"
E
r
r
o
r
!
"
;
Format .nix files ... with nixfmt (rfc style)
2025-01-24 12:37:47 +00:00
in
(
builtins
.
tryEval
<foobaz>
)
.
success
Reference in New Issue
Copy Permalink