aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/parser.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-09-27 13:55:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-09-30 15:30:45 +0200
commit12268f7741ba73c75a73fafb6063f1393e485aae (patch)
treec80fe4918c18702f6cb199c9016366338f8f5061 /libbuild2/parser.hxx
parente59c2bc979293d8cdea3f9733ecd59c080fce63c (diff)
Add support for custom match/extract functions in switch expression
Diffstat (limited to 'libbuild2/parser.hxx')
-rw-r--r--libbuild2/parser.hxx21
1 files changed, 15 insertions, 6 deletions
diff --git a/libbuild2/parser.hxx b/libbuild2/parser.hxx
index e199a9a..581ad1b 100644
--- a/libbuild2/parser.hxx
+++ b/libbuild2/parser.hxx
@@ -254,11 +254,6 @@ namespace build2
bool enter,
bool default_target);
- // If chunk is true, then parse the smallest but complete, name-wise,
- // chunk of input. Note that in this case you may still end up with
- // multiple names, for example, {foo bar} or $foo. In the pre-parse mode
- // always return empty list of names.
- //
// The what argument is used in diagnostics (e.g., "expected <what>
// instead of ...".
//
@@ -273,7 +268,21 @@ namespace build2
names
parse_names (token& t, token_type& tt,
pattern_mode pmode,
- bool chunk = false,
+ const char* what = "name",
+ const string* separators = &name_separators)
+ {
+ return parse_names (t, tt, pmode, false /* chunk */, what, separators);
+ }
+
+ // If chunk is true, then parse the smallest but complete, name-wise,
+ // chunk of input. Note that in this case you may still end up with
+ // multiple names, for example, {foo bar} or $foo. In the pre-parse mode
+ // always return empty list of names.
+ //
+ names
+ parse_names (token& t, token_type& tt,
+ pattern_mode pmode,
+ bool chunk,
const char* what = "name",
const string* separators = &name_separators)
{