about summary refs log tree commit diff
path: root/src/libexpr
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-10-11T21·59+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-10-11T21·59+0000
commit7d4567f2cc16959e827f542e6de76a28ff11789e (patch)
treefc68581e60d9f29359173ce8b5398d36b9ee125c /src/libexpr
parentb4e012ab4d8ef2f9091c1e8d14e059b38a2e4529 (diff)
* Removed URIs from the evaluator (NIX-66). They are now just another
  kind of notation for strings.

Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/eval.cc4
-rw-r--r--src/libexpr/expr-to-xml.cc3
-rw-r--r--src/libexpr/nixexpr-ast.def1
-rw-r--r--src/libexpr/nixexpr.cc2
-rw-r--r--src/libexpr/parser.y4
-rw-r--r--src/libexpr/primops.cc3
6 files changed, 4 insertions, 13 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 2d54f1fc2325..4f97c761ed98 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -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 ||
diff --git a/src/libexpr/expr-to-xml.cc b/src/libexpr/expr-to-xml.cc
index 085488bb5dd5..195cbd7b852a 100644
--- a/src/libexpr/expr-to-xml.cc
+++ b/src/libexpr/expr-to-xml.cc
@@ -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");
 
diff --git a/src/libexpr/nixexpr-ast.def b/src/libexpr/nixexpr-ast.def
index 4a92eaebf86b..b797fcfc440e 100644
--- a/src/libexpr/nixexpr-ast.def
+++ b/src/libexpr/nixexpr-ast.def
@@ -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 |
diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc
index 582eecaf75b3..a36b45bc1567 100644
--- a/src/libexpr/nixexpr.cc
+++ b/src/libexpr/nixexpr.cc
@@ -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";
diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y
index f5c3435e5f45..d13a1a1336b8 100644
--- a/src/libexpr/parser.y
+++ b/src/libexpr/parser.y
@@ -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'. */
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 761677a706b6..f35ba737d9c4 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -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;
 }