From 8b55e8151bd69e4ef11a67aff57618193f559618 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 7 Dec 2015 12:16:29 +0200 Subject: Add support for specifying minimum required build2 version The syntax is: using build@0.1.0-a1 The idea is that we will later also use it for modules and 'build' is a special, the "build system itself" module. Also fix a problem with peeking and lexer mode switching. --- build/lexer.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'build/lexer.cxx') diff --git a/build/lexer.cxx b/build/lexer.cxx index 79611c6..77e803c 100644 --- a/build/lexer.cxx +++ b/build/lexer.cxx @@ -17,6 +17,16 @@ namespace build return t; } + pair lexer:: + peek_char () + { + // In the quoted mode we don't skip spaces. + // + sep_ = mode_.top () != lexer_mode::quoted && skip_spaces (); + xchar c (peek ()); + return make_pair (eos (c) ? '\0' : char (c), sep_); + } + token lexer:: next_impl () { @@ -385,6 +395,9 @@ namespace build get (); } + r = r || sep_; + sep_ = false; + return r; } -- cgit v1.1