aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/context.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-04-28 08:48:53 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-05-27 15:47:28 +0200
commitb808c255b6a9ddba085bf5646e7d20ec344f2e2d (patch)
tree32730291f7e6de8ef0a227905520dd66fb4ec0f3 /libbuild2/context.cxx
parent3552356a87402727e663131994fa87f48b3cd4fb (diff)
Initial support for ad hoc recipes (still work in progress)
Diffstat (limited to 'libbuild2/context.cxx')
-rw-r--r--libbuild2/context.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/libbuild2/context.cxx b/libbuild2/context.cxx
index 0be0046..a3455ea 100644
--- a/libbuild2/context.cxx
+++ b/libbuild2/context.cxx
@@ -340,8 +340,10 @@ namespace build2
// And so the first token should be a word which can be either a
// variable name (potentially with the directory qualification) or just
// the directory, in which case it should be followed by another word
- // (unqualified variable name).
+ // (unqualified variable name). To avoid treating any of the visibility
+ // modifiers as special we use the cmdvar mode.
//
+ l.mode (lexer_mode::cmdvar);
token t (l.next ());
optional<dir_path> dir;
@@ -892,6 +894,14 @@ namespace build2
}
phase_switch::
+ phase_switch (phase_unlock&& u, phase_lock&& l)
+ : old_phase (u.l->phase), new_phase (l.phase)
+ {
+ phase_lock_instance = u.l; // Disarms phase_lock
+ u.l = nullptr; // Disarms phase_unlock
+ }
+
+ phase_switch::
~phase_switch () noexcept (false)
{
phase_lock* pl (phase_lock_instance);