CharPatterns Module
Active patterns over a Cursor{T,S,I} of characters: the parsers of
XParsec.CharParsers as patterns, and Until and Delimited.
Use them as the arms of a match, nesting a pattern in the cursor another binds:
match cursor with
| PString "//" (Until "\n" (comment, next)) -> ...
| PChar '"' (Until "\"" (text, next)) -> ...
val comment: obj
val next: obj
A pattern's arguments are evaluated each time the pattern is tried. The AnyString...
patterns build a lookup from their strings each time; in a hot loop, build the parser once with
CharParsers.anyString and match it with Parsed.
Active patterns
| Active pattern | Description |
|
|
Full Usage:
(|AnyStringByReturn|_|) comparison xs cursor
Parameters:
StringComparison
xs : (string * 'A) seq
cursor : Cursor<char, 'State, 'Input>
Returns: ('A * Cursor<char, 'State, 'Input>) voption
Modifiers: inline Type parameters: 'A, 'State, 'Input |
|
Full Usage:
(|AnyStringBy|_|) comparison xs cursor
Parameters:
StringComparison
xs : string seq
cursor : Cursor<char, 'State, 'Input>
Returns: (string * Cursor<char, 'State, 'Input>) voption
Modifiers: inline Type parameters: 'State, 'Input |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
(|PBigInt|_|) cursor
Parameters:
Cursor<char, 'State, 'Input>
Returns: (BigInteger * Cursor<char, 'State, 'Input>) voption
Modifiers: inline Type parameters: 'State, 'Input |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
XParsec.ActiveParsers