aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/primops.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-03-25 12:19:41 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-03-25 12:19:41 +0000
commit8a10360c912bc344ea9ce7f8871a47a6e036552f (patch)
tree09ed76a3e11754ee09c48cd491782848df169063 /src/libexpr/primops.cc
parent7482349fe8ba9f285f6c7e53d8573fc367ecff8b (diff)
* Simplify @-patterns: only `{attrs}@name' or `name@{attrs}' are now
allowed. So `name1@name2', `{attrs1}@{attrs2}' and so on are now no longer legal. This is no big loss because they were not useful anyway. This also changes the output of builtins.toXML for @-patterns slightly.
Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r--src/libexpr/primops.cc7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 7dddc91a8..52292f3f8 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -846,19 +846,14 @@ static void attrsInPattern(ATermMap & map, Pattern pat)
{
ATerm name;
ATermList formals;
- Pattern pat1, pat2;
ATermBool ellipsis;
- if (matchAttrsPat(pat, formals, ellipsis)) {
+ if (matchAttrsPat(pat, formals, ellipsis, name)) {
for (ATermIterator i(formals); i; ++i) {
ATerm def;
if (!matchFormal(*i, name, def)) abort();
map.set(name, makeAttrRHS(makeBool(def != constNoDefaultValue), makeNoPos()));
}
}
- else if (matchAtPat(pat, pat1, pat2)) {
- attrsInPattern(map, pat1);
- attrsInPattern(map, pat2);
- }
}