aboutsummaryrefslogtreecommitdiff
path: root/build2/lexer
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-10-20 15:33:39 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-11-04 09:26:33 +0200
commitea9d28c0e5fe16d5a0ade210f40cb98ea191d318 (patch)
treea7a3bc27a258d476d28220bcf0e6b7932f42d622 /build2/lexer
parentcf4af1e966c5f005d5cb4b4080a9e11c106982bd (diff)
Use special mode for attribute lexing
Diffstat (limited to 'build2/lexer')
-rw-r--r--build2/lexer14
1 files changed, 9 insertions, 5 deletions
diff --git a/build2/lexer b/build2/lexer
index df8c852..f0a0fa6 100644
--- a/build2/lexer
+++ b/build2/lexer
@@ -21,15 +21,18 @@ namespace build2
// characters (e.g., '+', '=') as special so that we can use them in the
// variable values, e.g., 'foo = g++'. In contrast, in the variable mode, we
// restrict certain character (e.g., '/') from appearing in the name. The
- // eval mode is used in the evaluation context. Quoted are internal modes
- // and should not be set explicitly.
+ // attribute mode is like value except it doesn't treat '{' and '}' as
+ // special (so we cannot have name groups in attributes). The eval mode is
+ // used in the evaluation context. Quoted are internal modes and should not
+ // be set explicitly.
//
// Note that the normal, value, and eval modes split words separated by the
// pair character (to disable pairs one can pass '\0' as a pair character).
//
- // The alternnative modes must be set manually. The value mode is
- // automatically reset after the end of the line. The variable mode is reset
- // after the word token. And the eval mode is reset after the closing ')'.
+ // The alternnative modes must be set manually. The value mode automatically
+ // expires after the end of the line. The attribute mode expires after the
+ // closing ']'. The variable mode expires after the word token. And the eval
+ // mode expires after the closing ')'.
//
// Note that normally it is only safe to switch mode when the current token
// is not quoted (or, more generally, when you are not in the double-quoted
@@ -49,6 +52,7 @@ namespace build2
normal = base_type::value_next,
variable,
value,
+ attribute,
eval,
single_quoted,
double_quoted,