From 28e9fd496fd39d180a2d786378c4ff396b9f69c8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 10 Jun 2020 10:32:15 +0200 Subject: Add ad hoc recipe if-else, switch tests (and fix bug) --- libbuild2/parser.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'libbuild2/parser.cxx') 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")); } -- cgit v1.1