aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/parser.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/parser.hxx')
-rw-r--r--libbuild2/parser.hxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/libbuild2/parser.hxx b/libbuild2/parser.hxx
index 3e1d0a0..b68bf7e 100644
--- a/libbuild2/parser.hxx
+++ b/libbuild2/parser.hxx
@@ -893,6 +893,9 @@ namespace build2
// Set the data and start playing.
//
+ // Note that using the const reference version is better than making a
+ // copy since it may reuse the existing capacity.
+ //
void
replay_data (replay_tokens&& d)
{
@@ -905,6 +908,18 @@ namespace build2
replay_ = replay::play;
}
+ void
+ replay_data (const replay_tokens& d)
+ {
+ assert (replay_ == replay::stop);
+
+ replay_path_ = path_; // Save old path.
+
+ replay_data_ = d;
+ replay_i_ = 0;
+ replay_ = replay::play;
+ }
+
// Implementation details, don't call directly.
//
replay_token