From 5ec57d68a5205173a02c34a24d7129347d43196c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 14 Nov 2019 12:55:54 +0200 Subject: 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 --- libbuild2/token.hxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'libbuild2/token.hxx') 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; -- cgit v1.1