about summary refs log tree commit diff
path: root/src/fix.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-08-18T16·32+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-08-18T16·32+0000
commit31e4aa64396858e3b6ef8477397c84cbd80670fc (patch)
tree29a36ca7d710550f3c217a5f68bace41e7622ff2 /src/fix.cc
parentebbb6ce578ab383bec7a61c364d2be27c0bad22f (diff)
* Allow lists in package bindings, e.g.,
    ("srcs", [Relative("foo/bar.c"), Relative("foo/baz.h")])

  The result is an environment variable that contains the path names of the
  inputs separated by spaces (so this is not safe for values containing
  spaces).

Diffstat (limited to '')
-rw-r--r--src/fix.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/fix.cc b/src/fix.cc
index 66ca5f1c21..ef35703342 100644
--- a/src/fix.cc
+++ b/src/fix.cc
@@ -169,6 +169,18 @@ static string processBinding(EvalState & state, Expr e, FState & fs)
     if (ATmatch(e, "True")) return "1";
     
     if (ATmatch(e, "False")) return "";
+
+    ATermList l;
+    if (ATmatch(e, "[<list>]", &l)) {
+	string s;
+	bool first = true;
+        while (!ATisEmpty(l)) {
+	    if (!first) s = s + " "; else first = false;
+	    s += processBinding(state, evalExpr(state, ATgetFirst(l)), fs);
+            l = ATgetNext(l);
+        }
+	return s;
+    }
     
     throw badTerm("invalid package binding", e);
 }