Skip to content

Rule - partial input.string() #25

Answered by d-frey
theduke asked this question in Q&A
Discussion options

You must be logged in to vote

The usual trick is to apply the action only to the part you are interested in:

struct module_identifier : identifier {};
struct module_decl : seq< string< 'm', 'o', 'd', 'u', 'l', 'e', ' ' >, module_identifier > {};

and then specialize your action for module_identifier. The additional struct is used to make sure the action is only applied for this case, not for other uses of identifier.

Does this work for you?

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by d-frey
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #25 on December 09, 2020 10:57.