diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2021-06-08 12:47:40 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2021-06-08 13:50:35 +0200 |
commit | 41cdd833e6ea37752be183541cfa5c5fbdc11ab1 (patch) | |
tree | 5d6705f426b2d3ad8bfc975a26b9b6e949e26681 /libbuild2/parser.cxx | |
parent | 23a8204d60a7f189fa4659f51b828599fc5838a3 (diff) |
Get rid of special *{} wildcard target type notation in target type/patterns
Explicit target{} should be used instead. Also, in this context, absent target
type is now treated as file{} rather than target{}, for consistency with all
other cases.
Diffstat (limited to 'libbuild2/parser.cxx')
-rw-r--r-- | libbuild2/parser.cxx | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/libbuild2/parser.cxx b/libbuild2/parser.cxx index a7e84f7..6f59b30 100644 --- a/libbuild2/parser.cxx +++ b/libbuild2/parser.cxx @@ -733,18 +733,11 @@ namespace build2 sg = enter_scope (*this, move (n.dir)); } - // Resolve target type. If none is specified or if it is '*', - // use the root of the target type hierarchy. So these are all - // equivalent: + // Resolve target type. If none is specified, then it's file{}. // - // *: foo = bar - // {*}: foo = bar - // *{*}: foo = bar - // - const target_type* ttype ( - n.untyped () || n.type == "*" - ? &target::static_type - : scope_->find_target_type (n.type)); + const target_type* ttype (n.untyped () + ? &file::static_type + : scope_->find_target_type (n.type)); if (ttype == nullptr) fail (nloc) << "unknown target type " << n.type; @@ -1074,12 +1067,8 @@ namespace build2 { // Resolve target type (same as in for_one_pat()). // - // @@ TODO: maybe untyped should mean file{} as everywhere else? - // Also, why do we bother with *{}, is it that hard to write - // target{*}? Note: here, in vars, and in regex_pattern. - // - ttype = n.untyped () || n.type == "*" - ? &target::static_type + ttype = n.untyped () + ? &file::static_type : scope_->find_target_type (n.type); if (ttype == nullptr) |