aboutsummaryrefslogtreecommitdiff
path: root/libbuild2
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-06-10 10:32:15 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-06-10 10:32:15 +0200
commit28e9fd496fd39d180a2d786378c4ff396b9f69c8 (patch)
tree39c3b9c30b3255054e7a4a80b57990cb1375a3af /libbuild2
parent1ea33ab70f88fcfebf388a9a438e3c1e56fbdf0f (diff)
Add ad hoc recipe if-else, switch tests (and fix bug)
Diffstat (limited to 'libbuild2')
-rw-r--r--libbuild2/parser.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/libbuild2/parser.cxx b/libbuild2/parser.cxx
index 36e75a3..21b5794 100644
--- a/libbuild2/parser.cxx
+++ b/libbuild2/parser.cxx
@@ -1356,6 +1356,13 @@ namespace build2
m.name = "perform";
}
}
+ else
+ {
+ // Default is perform(update).
+ //
+ bs.push_back (metaopspec ("perform"));
+ bs.back ().push_back (opspec ("update"));
+ }
expire_mode ();
next_after_newline (t, tt, "recipe action");
@@ -1395,11 +1402,10 @@ namespace build2
// Fall through.
}
-
- // Default is perform(update).
- //
- if (bs.empty ())
+ else
{
+ // Default is perform(update).
+ //
bs.push_back (metaopspec ("perform"));
bs.back ().push_back (opspec ("update"));
}