aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/lexer.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-11-17 11:23:36 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-11-17 11:23:36 +0200
commit818dd4a4e743bc8c93d1be67685b1f2e5db6dcf5 (patch)
tree57c35b478818ab69fd784263cce193e32bd58479 /libbuild2/cc/lexer.hxx
parent3ac5998ee4d5e30a35ce7c043b9389598d7f147f (diff)
Implement modules pseudo-directive parsing (p1703, p1857)
Diffstat (limited to 'libbuild2/cc/lexer.hxx')
-rw-r--r--libbuild2/cc/lexer.hxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/libbuild2/cc/lexer.hxx b/libbuild2/cc/lexer.hxx
index d3fe807..b4e1045 100644
--- a/libbuild2/cc/lexer.hxx
+++ b/libbuild2/cc/lexer.hxx
@@ -25,7 +25,8 @@ namespace build2
// as #line, #pragma, but not #include (which is diagnosed). Currently,
// all preprocessor directives except #line are ignored and no values are
// saved from literals. The #line directive (and its shorthand notation)
- // is recognized to provide the logical token location.
+ // is recognized to provide the logical token location. Note that the
+ // modules-related pseudo-directives are not recognized or handled.
//
// While at it we also calculate the checksum of the input ignoring
// comments, whitespaces, etc. This is used to detect changes that do not
@@ -58,6 +59,7 @@ namespace build2
struct token
{
token_type type = token_type::eos;
+ bool first = false; // First token of a logical line.
string value;
// Logical position.
@@ -121,7 +123,7 @@ namespace build2
private:
void
- next (token&, xchar, bool);
+ next (token&, pair<xchar, bool /* first */>, bool);
void
number_literal (token&, xchar);
@@ -141,7 +143,7 @@ namespace build2
void
line_directive (token&, xchar);
- xchar
+ pair<xchar, bool /* first */>
skip_spaces (bool newline = true);
// The char_scanner adaptation for newline escape sequence processing.