mirror of
https://github.com/NixOS/nix
synced 2025-06-27 08:31:16 +02:00
* Removed URIs from the evaluator (NIX-66). They are now just another
kind of notation for strings.
This commit is contained in:
parent
b4e012ab4d
commit
7d4567f2cc
10 changed files with 16 additions and 21 deletions
|
@ -254,8 +254,7 @@ string coerceToStringWithContext(EvalState & state,
|
|||
}
|
||||
|
||||
ATerm s;
|
||||
if (matchStr(e, s) || matchUri(e, s))
|
||||
return aterm2String(s);
|
||||
if (matchStr(e, s)) return aterm2String(s);
|
||||
|
||||
if (matchPath(e, s)) {
|
||||
isPath = true;
|
||||
|
@ -346,7 +345,6 @@ Expr evalExpr2(EvalState & state, Expr e)
|
|||
/* Normal forms. */
|
||||
if (sym == symStr ||
|
||||
sym == symPath ||
|
||||
sym == symUri ||
|
||||
sym == symNull ||
|
||||
sym == symInt ||
|
||||
sym == symBool ||
|
||||
|
|
|
@ -36,9 +36,6 @@ static void printTermAsXML(Expr e, XMLWriter & doc, ATermList & context)
|
|||
else if (matchPath(e, s))
|
||||
doc.writeEmptyElement("path", singletonAttrs("value", aterm2String(s)));
|
||||
|
||||
else if (matchUri(e, s))
|
||||
doc.writeEmptyElement("uri", singletonAttrs("value", aterm2String(s)));
|
||||
|
||||
else if (matchNull(e))
|
||||
doc.writeEmptyElement("null");
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@ Var | string | Expr |
|
|||
Int | int | Expr |
|
||||
Str | string | Expr |
|
||||
Path | string | Expr |
|
||||
Uri | string | Expr |
|
||||
List | ATermList | Expr |
|
||||
BlackHole | | Expr |
|
||||
Undefined | | Expr |
|
||||
|
|
|
@ -301,7 +301,6 @@ string showType(Expr e)
|
|||
int i1;
|
||||
if (matchStr(e, t1)) return "a string";
|
||||
if (matchPath(e, t1)) return "a path";
|
||||
if (matchUri(e, t1)) return "a path";
|
||||
if (matchNull(e)) return "null";
|
||||
if (matchInt(e, i1)) return "an integer";
|
||||
if (matchBool(e, t1)) return "a boolean";
|
||||
|
@ -330,7 +329,6 @@ string showValue(Expr e)
|
|||
return "\"" + u + "\"";
|
||||
}
|
||||
if (matchPath(e, s)) return aterm2String(s);
|
||||
if (matchUri(e, s)) return aterm2String(s);
|
||||
if (matchNull(e)) return "null";
|
||||
if (matchInt(e, i)) return (format("%1%") % i).str();
|
||||
if (e == eTrue) return "true";
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
%locations
|
||||
%error-verbose
|
||||
%defines
|
||||
%no-lines
|
||||
/* %no-lines */
|
||||
%parse-param { yyscan_t scanner }
|
||||
%parse-param { ParseData * data }
|
||||
%lex-param { yyscan_t scanner }
|
||||
|
@ -200,7 +200,7 @@ expr_simple
|
|||
else $$ = makeConcatStrings(ATreverse($2));
|
||||
}
|
||||
| PATH { $$ = makePath(toATerm(absPath(aterm2String($1), data->basePath))); }
|
||||
| URI { $$ = makeUri($1); }
|
||||
| URI { $$ = makeStr($1); }
|
||||
| '(' expr ')' { $$ = $2; }
|
||||
/* Let expressions `let {..., body = ...}' are just desugared
|
||||
into `(rec {..., body = ...}).body'. */
|
||||
|
|
|
@ -137,7 +137,6 @@ void toString(EvalState & state, Expr e,
|
|||
scripting convenience, just like `null'. */
|
||||
|
||||
if (matchStr(e, s)) result += aterm2String(s);
|
||||
else if (matchUri(e, s)) result += aterm2String(s);
|
||||
else if (e == eTrue) result += "1";
|
||||
else if (e == eFalse) ;
|
||||
else if (matchInt(e, n)) result += int2String(n);
|
||||
|
@ -482,7 +481,7 @@ static Expr primDirOf(EvalState & state, const ATermVector & args)
|
|||
ATerm coerceToString(Expr e)
|
||||
{
|
||||
ATerm s;
|
||||
if (matchStr(e, s) || matchPath(e, s) || matchUri(e, s))
|
||||
if (matchStr(e, s) || matchPath(e, s))
|
||||
return s;
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue