aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/lexer.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-06-10 10:00:55 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-06-10 10:00:55 +0200
commitd5faeeab1d2115c02a330ac9c95d63ba225faabc (patch)
tree410f9d2b8c70c30c74d799d4fa7695c6f367cd41 /libbuild2/lexer.hxx
parent2ee88b6041557beb517b100c3f608ebfc5eb725d (diff)
Handle special variable names in base lexer via mode data
Diffstat (limited to 'libbuild2/lexer.hxx')
-rw-r--r--libbuild2/lexer.hxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/libbuild2/lexer.hxx b/libbuild2/lexer.hxx
index d5f1c99..f577828 100644
--- a/libbuild2/lexer.hxx
+++ b/libbuild2/lexer.hxx
@@ -56,6 +56,13 @@ namespace build2
// single-quote mode. The number of closing braces to expect is passed as
// mode data.
//
+ // The mode data is also used by a few other modes. The buildspec mode uses
+ // it as a boolean value to decide whether to recognize newlines as tokens.
+ // In the variable mode the mode data may be a pointer to a C string that
+ // contains a list of special one-character variable names to recognize
+ // (e.g., $<, $~, etc). Note that the parser has a special kludge to also
+ // recognize them as $(<), etc.
+ //
// The alternative modes must be set manually. The value/values and derived
// modes automatically expires after the end of the line. The attribute and
// subscript modes expires after the closing `]`. The variable mode expires