From 0d0d9a9c56822919e9794658d31db57f8fc3e2bf Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 10 Dec 2015 13:54:59 +0200 Subject: Implement two-phase initialization of modules loaded from bootstrap.build --- build/parser | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'build/parser') 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 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). -- cgit v1.1