Patterns Module
Active patterns over a Cursor{T,S,I} for any item type: the parsers of
XParsec.Parsers as patterns, and patterns to run other parsers.
A pattern that parses a value binds the value and the cursor after it, Name (value, next);
a pattern that only consumes input binds the cursor after it, Name next. Nest a pattern in
next to parse what follows:
| Item '(' (Parsed expr (e, Item ')' next)) -> ValueSome(e, next)
union case ValueOption.ValueSome: 'T -> ValueOption<'T>
Each pattern named after an XParsec parser runs that parser, so it matches exactly what the parser
accepts. The ...Return, ...L and skip... variants have no pattern of their own:
return the value from the arm, label the parser built with ActiveParser.toParserL, and ignore
the value bound by the pattern.
Active patterns
| Active pattern | Description |
Full Usage:
(|Active|_|) p cursor
Parameters:
ActiveParser<'A, 'T, 'State, 'Input>
cursor : Cursor<'T, 'State, 'Input>
Returns: ('A * Cursor<'T, 'State, 'Input>) voption
Modifiers: inline Type parameters: 'A, 'T, 'State, 'Input |
|
|
|
|
|
Full Usage:
(|EOF|_|) cursor
Parameters:
Cursor<'T, 'State, 'Input>
Returns: unit voption
Modifiers: inline Type parameters: 'T, 'State, 'Input |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
(|UserStateSatisfies|_|) predicate cursor
Parameters:
'State -> bool
cursor : Cursor<'T, 'State, 'Input>
Returns: unit voption
Modifiers: inline Type parameters: 'State, 'T, 'Input |
|
|
XParsec.ActiveParsers