-
Notifications
You must be signed in to change notification settings - Fork 11
allow cfg attributes on substitution groups #63
Copy link
Copy link
Open
Labels
D-discussionA decision (D) has not been made yet and is open to discussionA decision (D) has not been made yet and is open to discussionI-featureThis issue (I) regards a (potential) feature in the projectThis issue (I) regards a (potential) feature in the projectT-acceptedTriage (T): Initial review accepted issue/PR as validTriage (T): Initial review accepted issue/PR as valid
Metadata
Metadata
Assignees
Labels
D-discussionA decision (D) has not been made yet and is open to discussionA decision (D) has not been made yet and is open to discussionI-featureThis issue (I) regards a (potential) feature in the projectThis issue (I) regards a (potential) feature in the projectT-acceptedTriage (T): Initial review accepted issue/PR as validTriage (T): Initial review accepted issue/PR as valid
Short Description:
Allows the use of
cfgattributes on substitution groups, such that they can be enabled and disabled at build time.Motivation:
See this code.
Here, they use two
cfg_attrs to remove one substitution group based on whether a specific feature is enabled.This is a bit ugly, as the two invocations of
duplicateare identical except for the second substitution group not being present on the second invocation.Therefore, the first substitution group is actually copied between the two invocations.
It would be better to be able to, within the invocation itself, be able to disable a substitution group using a method akin to
cfg_attr.Design
This could be one way of designing it (this is using verbose syntax to match that of the above example):
This will disable the second substitution group when the
non_blockingfeature is disabled, exactly like the current semantics of the above example.This would work the same way for the short syntax and global substitutions (where each attribute would work on just one substitution group or substitution).
Misc:
Open questions:
cfg_attrdirectly fromduplicate, such that it can return an empty string when thecfgis false?cfgorcfg_attr?