aboutsummaryrefslogtreecommitdiff
path: root/build/parser
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-12-10 13:54:59 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-12-10 13:54:59 +0200
commit0d0d9a9c56822919e9794658d31db57f8fc3e2bf (patch)
tree6dcb1649706dc7fc3f02cd5646b4611b3309fbd1 /build/parser
parent5f29fc16fb85a934280e00e54bc6307685c4e05d (diff)
Implement two-phase initialization of modules loaded from bootstrap.build
Diffstat (limited to 'build/parser')
-rw-r--r--build/parser9
1 files changed, 7 insertions, 2 deletions
diff --git a/build/parser b/build/parser
index 08d587a..4630110 100644
--- a/build/parser
+++ b/build/parser
@@ -27,7 +27,10 @@ namespace build
typedef build::names names_type;
typedef build::variable variable_type;
- parser (): fail (&path_) {}
+ // If boot is true, then we are parsing bootstrap.build and modules
+ // should only be bootstrapped.
+ //
+ parser (bool boot = false): fail (&path_), boot_ (boot) {}
// Issue diagnostics and throw failed in case of an error.
//
@@ -183,7 +186,9 @@ namespace build
const fail_mark<failed> fail;
protected:
- const std::string* path_; // Path processed by diag_relative().
+ bool boot_;
+
+ const std::string* path_; // Path processed by diag_relative() and pooled.
lexer* lexer_;
target* target_; // Current target, if any.
scope* scope_; // Current base scope (out_base).