aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-11-03 17:52:18 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-11-04 09:26:37 +0200
commit7ebe4aa8d07e8845f1669e2d43fbe6071d3ee463 (patch)
tree3395bf9ee7bd05eeed6f8d5b9e09e197e213bfcc
parent96f85239a37b45c6a61a61adbcd7ed51673cee3f (diff)
Make newline token always separated from previous one
-rw-r--r--build2/lexer.cxx3
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);