about summary refs log tree commit diff
path: root/src/fix.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-07-08T13·22+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-07-08T13·22+0000
commit40274c1f4f763e634dd031f7a6b4ba8ce2de7a82 (patch)
tree87f701e59cbe12fc86a9e67aa04ac1321533400c /src/fix.cc
parenta279137327ad5762bb26a23ce8ed7863812254ae (diff)
* A command to query the paths referenced by an fstate expression.
* Use a temporary directory for build actions.

Diffstat (limited to 'src/fix.cc')
-rw-r--r--src/fix.cc30
1 files changed, 3 insertions, 27 deletions
diff --git a/src/fix.cc b/src/fix.cc
index 87ce7c775a..508a441167 100644
--- a/src/fix.cc
+++ b/src/fix.cc
@@ -13,29 +13,6 @@ typedef ATerm Expr;
 static Expr evalFile(string fileName);
 
 
-static bool isFState(Expr e, string & path)
-{
-    char * s1, * s2, * s3;
-    Expr e1, e2;
-    if (ATmatch(e, "Path(<str>, <term>, [<list>])", &s1, &e1, &e2)) {
-        path = s1;
-        return true;
-    }
-    else if (ATmatch(e, "Derive(<str>, <str>, [<list>], <str>, [<list>])",
-                   &s1, &s2, &e1, &s3, &e2))
-    {
-        path = s3;
-        return true;
-    }
-    else if (ATmatch(e, "Include(<str>)", &s1))
-    {
-        string fn = queryPathByHash(parseHash(s1));
-        return isFState(evalFile(fn), path);
-    }
-    else return false;
-}
-
-
 static Expr substExpr(string x, Expr rep, Expr e)
 {
     char * s;
@@ -113,8 +90,7 @@ static Expr evalExpr(Expr e)
         ATmatch(e, "Function([<list>], <term>)", &e1, &e2))
         return e;
 
-    string dummy;
-    if (isFState(e, dummy)) return e;
+    if (fstatePath(e) != "") return e; /* !!! hack */
 
     /* Application. */
     if (ATmatch(e, "App(<term>, [<list>])", &e1, &e2)) {
@@ -165,8 +141,8 @@ static Expr evalExpr(Expr e)
             string key = it->first;
             ATerm value = it->second;
 
-            string path;
-            if (isFState(value, path)) {
+            string path = fstatePath(value);
+            if (path != "") {
                 ins = ATinsert(ins, value);
                 env = ATinsert(env, ATmake("(<str>, <str>)",
                     key.c_str(), path.c_str()));