aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/token.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-11-14 12:55:54 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-11-14 13:20:08 +0200
commit5ec57d68a5205173a02c34a24d7129347d43196c (patch)
tree303de46753bcde9f9ccff094d6591b6bb7583931 /libbuild2/token.hxx
parent62a688e3fd7d1fdb8ce5590ebe9cb99e90cbe5d7 (diff)
Tighten up attribute recognition during parsing
Now it should be possible to use `[]` for wildcard patterns, for example: foo = foo.[hit]xx Note that a leading bracket expression will still be recognized as attributes and escaping or quoting it will inhibit pattern matching. To resolve this case we need to specify an empty attribute list: foo = [] [abc]-foo.cxx
Diffstat (limited to 'libbuild2/token.hxx')
-rw-r--r--libbuild2/token.hxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/libbuild2/token.hxx b/libbuild2/token.hxx
index 2370f8d..e420aa8 100644
--- a/libbuild2/token.hxx
+++ b/libbuild2/token.hxx
@@ -14,7 +14,8 @@
namespace build2
{
- // Extendable/inheritable enum-like class.
+
+ // Token type.
//
// A line consists of a sequence of words separated by separators and
// terminated with the newline. If whitespace is a separator, then it is
@@ -22,6 +23,8 @@ namespace build2
//
struct token_type
{
+ // Extendable/inheritable enum-like class.
+ //
enum
{
// NOTE: remember to update token_printer()!
@@ -145,10 +148,12 @@ namespace build2
inline ostream&
operator<< (ostream& o, const token& t) {t.printer (o, t, true); return o;}
- // Extendable/inheritable enum-like class.
+ // Context-dependent lexing (see lexer_mode for details).
//
struct lexer_mode_base
{
+ // Extendable/inheritable enum-like class.
+ //
enum { value_next };
using value_type = uint16_t;