aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/parser.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/parser.hxx')
-rw-r--r--libbuild2/parser.hxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/libbuild2/parser.hxx b/libbuild2/parser.hxx
index f806568..61ecd5b 100644
--- a/libbuild2/parser.hxx
+++ b/libbuild2/parser.hxx
@@ -91,6 +91,12 @@ namespace build2
parse_export_stub (istream& is, const path_name& name,
scope& rs, scope& bs)
{
+ auto g = make_guard ([this, old = imported_] () mutable
+ {
+ imported_ = old;
+ });
+ imported_ = true;
+
parse_buildfile (is, name, &rs, bs);
return move (export_value);
}
@@ -906,6 +912,9 @@ namespace build2
small_vector<attributes, 2> attributes_;
+ bool imported_ = false; // True if loaded via export stub.
+ optional<location> condition_; // Innermost if/switch (but not in recipe).
+
target* default_target_ = nullptr;
replay_token peek_;