1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

* Allow integer bindings in derivations.

This commit is contained in:
Eelco Dolstra 2003-11-25 12:05:48 +00:00
parent d1d87badf6
commit 6e8c19714a
4 changed files with 25 additions and 1 deletions

View file

@ -127,6 +127,7 @@ Expr evalExpr2(EvalState & state, Expr e)
if (atMatch(m, e) >> "Str" ||
atMatch(m, e) >> "Path" ||
atMatch(m, e) >> "Uri" ||
atMatch(m, e) >> "Int" ||
atMatch(m, e) >> "Bool" ||
atMatch(m, e) >> "Function" ||
atMatch(m, e) >> "Attrs" ||

View file

@ -89,6 +89,13 @@ static string processBinding(EvalState & state, Expr e, StoreExpr & ne)
if (atMatch(m, e) >> "Bool" >> "True") return "1";
if (atMatch(m, e) >> "Bool" >> "False") return "";
int n;
if (atMatch(m, e) >> "Int" >> n) {
ostringstream st;
st << n;
return st.str();
}
if (atMatch(m, e) >> "Attrs" >> es) {
Expr a = queryAttr(e, "type");
if (a && evalString(state, a) == "derivation") {