diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-04-26 12:43:15 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-04-26 12:43:15 +0200 |
commit | f6e6cfc3b5c7c84dedddc95084c423608769d4b7 (patch) | |
tree | 6602234ad3d053280ed43c3fc66391fcc9ae6356 /build2/lexer.cxx | |
parent | a7432e49d4c5009990da9bafb9c62a9542b04ac6 (diff) |
Fix bug in pair handling
Diffstat (limited to 'build2/lexer.cxx')
-rw-r--r-- | build2/lexer.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/build2/lexer.cxx b/build2/lexer.cxx index d3afdb0..e117f28 100644 --- a/build2/lexer.cxx +++ b/build2/lexer.cxx @@ -119,9 +119,11 @@ namespace build2 xchar c (get ()); uint64_t ln (c.line), cn (c.column); - auto make_token = [&sep, ln, cn] (type t) + auto make_token = [&sep, ln, cn] (type t, string v = string ()) { - return token (t, sep, ln, cn, token_printer); + return token (t, move (v), + sep, quote_type::unquoted, false, + ln, cn, token_printer); }; if (eos (c)) @@ -130,7 +132,7 @@ namespace build2 // Handle pair separator. // if (c == st.sep_pair) - return make_token (type::pair_separator); + return make_token (type::pair_separator, string (1, c)); switch (c) { @@ -232,9 +234,11 @@ namespace build2 uint64_t ln (c.line), cn (c.column); - auto make_token = [sep, ln, cn] (type t) + auto make_token = [sep, ln, cn] (type t, string v = string ()) { - return token (t, sep, ln, cn, token_printer); + return token (t, move (v), + sep, quote_type::unquoted, false, + ln, cn, token_printer); }; // This mode is quite a bit like the value mode when it comes to special @@ -244,7 +248,7 @@ namespace build2 // Handle pair separator. // if (c == st.sep_pair) - return make_token (type::pair_separator); + return make_token (type::pair_separator, string (1, c)); // Note: we don't treat [ and ] as special here. Maybe can use them for // something later. |