diff options
Diffstat (limited to 'libbuild2/script/parser.cxx')
-rw-r--r-- | libbuild2/script/parser.cxx | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/libbuild2/script/parser.cxx b/libbuild2/script/parser.cxx index b0431a9..fffe7bb 100644 --- a/libbuild2/script/parser.cxx +++ b/libbuild2/script/parser.cxx @@ -1084,17 +1084,24 @@ namespace build2 "command line", nullptr); - // Nothing else to do if we are pre-parsing. + // Nothing else to do if we are pre-parsing (or if parse_program() + // took care of this chunk). // - if (pre_parse_) + if (pre_parse_ || ns.empty ()) break; - // Process what we got. Determine whether anything inside was - // quoted (note that the current token is "next" and is not part - // of this). + // Process what we got. + // + // First see if this is a value that should not be re-lexed. The + // long term plan is to only re-lex values of a special type + // representing a canned command line. + // + // Otherwise, determine whether anything inside was quoted (note + // that the current token is "next" and is not part of this). // - bool q ((quoted () - - (t.qtype != quote_type::unquoted ? 1 : 0)) != 0); + bool q ( + (pr.value && !relex_) || + (quoted () - (t.qtype != quote_type::unquoted ? 1 : 0)) != 0); for (name& n: ns) { |