aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/lexer.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-09-29 15:17:33 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-09-29 15:17:33 +0200
commit04bf0b7cbe98c70d7e434e24a3eb4b03889c0c56 (patch)
tree8c9d7a26058fd65433a2ba893e2da1aeacbc9dfe /libbuild2/lexer.cxx
parent785087aa43cf962855724b8fa5da393022204a14 (diff)
Tighten low-verbosity diagnostics name deduction logic
Specifically, don't try to derive low-verbosity name from what looks like an eval context of a function call.
Diffstat (limited to 'libbuild2/lexer.cxx')
-rw-r--r--libbuild2/lexer.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/libbuild2/lexer.cxx b/libbuild2/lexer.cxx
index 992e5d1..76c31be 100644
--- a/libbuild2/lexer.cxx
+++ b/libbuild2/lexer.cxx
@@ -42,6 +42,22 @@ namespace build2
return make_pair (make_pair (r[0], r[1]), sep_);
}
+ pair<char, bool> lexer::
+ peek_char ()
+ {
+ auto p (skip_spaces ());
+ assert (!p.second);
+ sep_ = p.first;
+
+ char r ('\0');
+
+ xchar c (peek ());
+ if (!eos (c))
+ r = c;
+
+ return make_pair (r, sep_);
+ }
+
void lexer::
mode (lexer_mode m, char ps, optional<const char*> esc, uintptr_t data)
{