__anonymous.match

Match all next characters against the function until it returns false.

struct __anonymous
TString
match
(
Checker check
)

Parameters

check
Type: Checker

Function to match against.

Return Value

Type: TString

All matched characters.

Examples

1 auto stream = parsingStream("This is a sentence.");
2 ParsingStream.Checker check = a => a.isAlpha;
3 
4 // Match whole words
5 assert(stream.skip.match(check) == "This");
6 assert(stream.skip.match(check) == "is");
7 assert(stream.skip.match(check) != "not");
8 assert(stream.skip.match(check) == "sentence");
9 

Meta