Match multiple items in order. Each matcher in the pattern will be tested against the source in order, and will
advance the range before the next item in the pattern. The full pattern has to match.
match is a building block for any other pattern matching function. It will automatically call the proper
matcher (either the given matcher function, or basicMatcher as a fallback for convenience), and it can be used
to build any other sequential patterns (such as matchRepeat) by utilising the context parameter.
A matcher function will be tried with each of the following:
* fun(input, capture) if the function returns capture data, to pass on data from its previous iterations.
* fun(input) to perform a regular match.
* basicMatcher!fun(input) as a convenience call for the chosen basicMatcher; for example, the default
basicMatcher for any dchar range would allow using strings as match patterns:
match!"struct"("struct Foo")
* If none of those can compile, match will output the errors of fun(input) and basicMatcher!fun(input).
templatematch(pattern...)
mixintemplatemakeParser(Input, alias supply, alias basicMatcher)
Match multiple items in order. Each matcher in the pattern will be tested against the source in order, and will advance the range before the next item in the pattern. The full pattern has to match.
match is a building block for any other pattern matching function. It will automatically call the proper matcher (either the given matcher function, or basicMatcher as a fallback for convenience), and it can be used to build any other sequential patterns (such as matchRepeat) by utilising the context parameter.
A matcher function will be tried with each of the following:
* fun(input, capture) if the function returns capture data, to pass on data from its previous iterations. * fun(input) to perform a regular match. * basicMatcher!fun(input) as a convenience call for the chosen basicMatcher; for example, the default basicMatcher for any dchar range would allow using strings as match patterns: match!"struct"("struct Foo") * If none of those can compile, match will output the errors of fun(input) and basicMatcher!fun(input).