diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-11-03 17:52:18 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-11-04 09:26:37 +0200 |
commit | 7ebe4aa8d07e8845f1669e2d43fbe6071d3ee463 (patch) | |
tree | 3395bf9ee7bd05eeed6f8d5b9e09e197e213bfcc | |
parent | 96f85239a37b45c6a61a61adbcd7ed51673cee3f (diff) |
Make newline token always separated from previous one
-rw-r--r-- | build2/lexer.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/build2/lexer.cxx b/build2/lexer.cxx index 38d33ae..0ce9770 100644 --- a/build2/lexer.cxx +++ b/build2/lexer.cxx @@ -107,7 +107,7 @@ 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) { return token (t, sep, ln, cn, token_printer); }; @@ -132,6 +132,7 @@ namespace build2 if (m == lexer_mode::value) state_.pop (); + sep = true; // Treat newline as always separated. return make_token (type::newline); } case '{': return make_token (type::lcbrace); |