CombinatorPatterns Module
The combinators of XParsec.Combinators as active patterns. Each takes XParsec parsers, as its
combinator does, runs the combinator, and binds its value and the cursor after it.
The combinators that a match already expresses have no pattern: nest patterns to sequence
parsers (>>., .>>, .>>., tuple2, pipe2, bind), map the
value in the arm (|>>, >>%), write alternatives as arms (<|>,
<|>%), and match the next item for dispatch. Patterns carry no error, so the labels
(<?>, choiceL, followedByL, ...) have none either; ignore the value of a pattern
for the skip... combinators.
To run an active parser with a combinator, turn it into a parser with ActiveParser.toParser.
Active patterns
| Active pattern | Description |
Full Usage:
(|Between|_|) pOpen pClose p cursor
Parameters:
Parser<'A, 'T, 'State, 'Input>
pClose : Parser<'B, 'T, 'State, 'Input>
p : Parser<'C, 'T, 'State, 'Input>
cursor : Cursor<'T, 'State, 'Input>
Returns: ('C * Cursor<'T, 'State, 'Input>) voption
Modifiers: inline Type parameters: 'A, 'T, 'State, 'Input, 'B, 'C |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
(|FollowedBy|_|) p cursor
Parameters:
Parser<'A, 'T, 'State, 'Input>
cursor : Cursor<'T, 'State, 'Input>
Returns: unit voption
Modifiers: inline Type parameters: 'A, 'T, 'State, 'Input |
|
Full Usage:
(|LookAhead|_|) p cursor
Parameters:
Parser<'A, 'T, 'State, 'Input>
cursor : Cursor<'T, 'State, 'Input>
Returns: 'A voption
Modifiers: inline Type parameters: 'A, 'T, 'State, 'Input |
|
Full Usage:
(|Many1Items2|_|) p1 p cursor
Parameters:
Parser<'A, 'T, 'State, 'Input>
p : Parser<'A, 'T, 'State, 'Input>
cursor : Cursor<'T, 'State, 'Input>
Returns: (ImmutableArray<'A> * Cursor<'T, 'State, 'Input>) voption
Modifiers: inline Type parameters: 'A, 'T, 'State, 'Input |
|
Full Usage:
(|Many1Till|_|) p pEnd cursor
Parameters:
Parser<'A, 'T, 'State, 'Input>
pEnd : Parser<'B, 'T, 'State, 'Input>
cursor : Cursor<'T, 'State, 'Input>
Returns: ((ImmutableArray<'A> * 'B) * Cursor<'T, 'State, 'Input>) voption
Modifiers: inline Type parameters: 'A, 'T, 'State, 'Input, 'B |
|
Full Usage:
(|Many1|_|) p cursor
Parameters:
Parser<'A, 'T, 'State, 'Input>
cursor : Cursor<'T, 'State, 'Input>
Returns: (ImmutableArray<'A> * Cursor<'T, 'State, 'Input>) voption
Modifiers: inline Type parameters: 'A, 'T, 'State, 'Input |
|
Full Usage:
(|ManyTill|_|) p pEnd cursor
Parameters:
Parser<'A, 'T, 'State, 'Input>
pEnd : Parser<'B, 'T, 'State, 'Input>
cursor : Cursor<'T, 'State, 'Input>
Returns: ((ImmutableArray<'A> * 'B) * Cursor<'T, 'State, 'Input>) voption
Modifiers: inline Type parameters: 'A, 'T, 'State, 'Input, 'B |
|
Full Usage:
(|Many|_|) p cursor
Parameters:
Parser<'A, 'T, 'State, 'Input>
cursor : Cursor<'T, 'State, 'Input>
Returns: (ImmutableArray<'A> * Cursor<'T, 'State, 'Input>) voption
Modifiers: inline Type parameters: 'A, 'T, 'State, 'Input |
|
|
|
Full Usage:
(|NotFollowedBy|_|) p cursor
Parameters:
Parser<'A, 'T, 'State, 'Input>
cursor : Cursor<'T, 'State, 'Input>
Returns: unit voption
Modifiers: inline Type parameters: 'A, 'T, 'State, 'Input |
|
|
|
|
|
Full Usage:
(|PArray|_|) n p cursor
Parameters:
int
p : Parser<'A, 'T, 'State, 'Input>
cursor : Cursor<'T, 'State, 'Input>
Returns: (ImmutableArray<'A> * Cursor<'T, 'State, 'Input>) voption
Modifiers: inline Type parameters: 'A, 'T, 'State, 'Input |
|
Full Usage:
(|SepBy1|_|) p pSep cursor
Parameters:
Parser<'A, 'T, 'State, 'Input>
pSep : Parser<'B, 'T, 'State, 'Input>
cursor : Cursor<'T, 'State, 'Input>
Returns: ((ImmutableArray<'A> * ImmutableArray<'B>) * Cursor<'T, 'State, 'Input>) voption
Modifiers: inline Type parameters: 'A, 'T, 'State, 'Input, 'B |
|
Full Usage:
(|SepBy|_|) p pSep cursor
Parameters:
Parser<'A, 'T, 'State, 'Input>
pSep : Parser<'B, 'T, 'State, 'Input>
cursor : Cursor<'T, 'State, 'Input>
Returns: ((ImmutableArray<'A> * ImmutableArray<'B>) * Cursor<'T, 'State, 'Input>) voption
Modifiers: inline Type parameters: 'A, 'T, 'State, 'Input, 'B |
|
Full Usage:
(|SepEndBy1|_|) p pSep cursor
Parameters:
Parser<'A, 'T, 'State, 'Input>
pSep : Parser<'B, 'T, 'State, 'Input>
cursor : Cursor<'T, 'State, 'Input>
Returns: ((ImmutableArray<'A> * ImmutableArray<'B>) * Cursor<'T, 'State, 'Input>) voption
Modifiers: inline Type parameters: 'A, 'T, 'State, 'Input, 'B |
|
Full Usage:
(|SepEndBy|_|) p pSep cursor
Parameters:
Parser<'A, 'T, 'State, 'Input>
pSep : Parser<'B, 'T, 'State, 'Input>
cursor : Cursor<'T, 'State, 'Input>
Returns: ((ImmutableArray<'A> * ImmutableArray<'B>) * Cursor<'T, 'State, 'Input>) voption
Modifiers: inline Type parameters: 'A, 'T, 'State, 'Input, 'B |
|
XParsec.ActiveParsers