diff options
Diffstat (limited to 'libbuild2/build/script/parser.cxx')
-rw-r--r-- | libbuild2/build/script/parser.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libbuild2/build/script/parser.cxx b/libbuild2/build/script/parser.cxx index d26b155..c64bcd9 100644 --- a/libbuild2/build/script/parser.cxx +++ b/libbuild2/build/script/parser.cxx @@ -20,8 +20,8 @@ namespace build2 // Pre-parse. // - void parser:: - pre_parse (istream& is, const path_name& pn, uint64_t line, script& s) + script parser:: + pre_parse (istream& is, const path_name& pn, uint64_t line) { path_ = &pn; @@ -30,17 +30,20 @@ namespace build2 lexer l (is, *path_, line, lexer_mode::command_line); set_lexer (&l); + script s; script_ = &s; runner_ = nullptr; environment_ = nullptr; - script_->start_loc = location (*path_, line, 1); + s.start_loc = location (*path_, line, 1); token t (pre_parse_script ()); assert (t.type == type::eos); - script_->end_loc = get_location (t); + s.end_loc = get_location (t); + + return s; } token parser:: |