makeParser.match

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).

Members

Aliases

Local
alias Local = MatchType!(pattern[index])
Undocumented in source.
Return
alias Return = MatchType!pattern
Undocumented in source.

Static variables

data
auto data;
Undocumented in source.
lastCapture
auto lastCapture;
Undocumented in source.
local
Local local;
Undocumented in source.
result
Return result;
Undocumented in source.
source
Input source;
Undocumented in source.

Parameters

pattern

Pattern that has to be matched.

Meta