aboutsummaryrefslogtreecommitdiff
path: root/build2/lexer
diff options
context:
space:
mode:
Diffstat (limited to 'build2/lexer')
-rw-r--r--build2/lexer10
1 files changed, 6 insertions, 4 deletions
diff --git a/build2/lexer b/build2/lexer
index 59150a9..e2cf07c 100644
--- a/build2/lexer
+++ b/build2/lexer
@@ -85,7 +85,9 @@ namespace build2
// specifythe pair separator character (if the mode supports pairs).
//
virtual void
- mode (lexer_mode, char pair_separator = '\0');
+ mode (lexer_mode,
+ char pair_separator = '\0',
+ const char* escapes = nullptr);
// Expire the current mode early.
//
@@ -119,6 +121,8 @@ namespace build2
bool sep_space; // Are whitespaces separators (see skip_spaces())?
bool quotes; // Recognize quoted fragments.
+ const char* escapes; // Effective escape sequences to recognize.
+
// Word separator characters. For two-character sequence put the first
// one in sep_first and the second one in the corresponding position of
// sep_second. If it's a single-character sequence, then put space in
@@ -170,16 +174,14 @@ namespace build2
: char_scanner (is),
fail ("error", &name_),
name_ (n),
- escapes_ (e),
processor_ (p),
sep_ (false)
{
if (sm)
- mode (lexer_mode::normal, '@');
+ mode (lexer_mode::normal, '@', e);
}
const path name_;
- const char* escapes_;
void (*processor_) (token&, const lexer&);
std::stack<state> state_;