-
Notifications
You must be signed in to change notification settings - Fork 4
/
XParsec.fsi
129 lines (101 loc) · 4.93 KB
/
XParsec.fsi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
// Copyright (c) Cetin Sert 2012
// License: Simplified BSD.
module XParsec
open System
val inline Δ<'a> : 'a
[<Struct>]
type Source<'s,'a> =
val State : 's
val Current : 'a
new : 's * 'a -> Source<'s,'a>
type Reply<'b_> = S of 'b_ | F | Q with
member inline Value : 'b_
member inline IsMatch : bool
static member inline fromBool : bool -> unit Reply
static member inline negate : 'a Reply -> unit Reply
static member inline toOption : 'a Reply -> 'a Option
static member inline put : 'b -> 'a Reply -> 'b Reply
static member inline map : ('a -> 'b) -> 'a Reply -> 'b Reply
static member inline choose : ('a -> 'b option) -> 'a Reply -> 'b Reply
type Parser<'s,'a,'b> = Source<'s,'a> -> Reply<'b> * Source<'s,'a>
val inline reply : 'b*_ -> 'b
val inline source : _*'s -> 's
[<AutoOpen>]
module Combinators =
val inline ( ?-> ) : bool -> 'a -> 'a option
val inline current : Parser<'s,'a,'a>
val inline future : unit -> Parser<'s,'a,'b> * Parser<'s,'a,'b> ref
val inline ( !! ) : Parser<'s,'a,'b> -> Parser<'s,'a,'b>
val inline ( ~- ) : Parser<'s,'a,'b> -> Parser<'s,'a,unit>
val inline ( => ) : Parser<'s,'a,'b> -> ('b -> 'c) -> Parser<'s,'a,'c>
val inline ( ?> ) : Parser<'s,'a,'b> -> ('b -> 'c option) -> Parser<'s,'a,'c>
val inline ( .> ) : Parser<'s,'a,'b> -> Parser<'s,'a,'c> -> Parser<'s,'a,'b>
val inline ( >. ) : Parser<'s,'a,'b> -> Parser<'s,'a,'c> -> Parser<'s,'a,'c>
val inline ( .>. ) : Parser<'s,'a,'b> -> Parser<'s,'a,'c> -> Parser<'s,'a,'b*'c>
val inline ( </> ) : Parser<'s,'a,'b> -> Parser<'s,'a,'b> -> Parser<'s,'a,'b>
val inline manyMax : int -> Parser<'s,'a,'b> -> Parser<'s,'a,'b list>
val inline many : Parser<'s,'a,'b> -> Parser<'s,'a,'b list>
val inline many1 : Parser<'s,'a,'b> -> Parser<'s,'a,'b list>
val inline array : int -> Parser<'s,'a,'b> -> Parser<'s,'a,'b []>
val inline skipManyMax : int -> Parser<'s,'a,'b> -> Parser<'s,'a,int>
val inline skipMany : Parser<'s,'a,'b> -> Parser<'s,'a,int>
val inline skipMany1 : Parser<'s,'a,'b> -> Parser<'s,'a,int>
val inline skipN : int -> Parser<'s,'a,'b> -> Parser<'s,'a,unit>
val inline ( !*. ) : Parser<'s,'a,'b> -> Parser<'s,'a,'b list>
val inline ( !+. ) : Parser<'s,'a,'b> -> Parser<'s,'a,'b list>
val inline ( !* ) : Parser<'s,'a,'b> -> Parser<'s,'a,int>
val inline ( !+ ) : Parser<'s,'a,'b> -> Parser<'s,'a,int>
val inline ( >>= ) : Parser<'s,'a,'b> -> ('b -> Parser<'s,'a,'c>) -> Parser<'s,'a,'c>
module Array =
type Position = Int32
type 'a Stream = Source<'a [], Position>
val pre : Position
val post : Position
module Array = val inline source : Position -> 'a seq -> Source<'a Stream,'a>
[<AutoOpen>]
module Navigation =
val inline next : Parser<'a Stream,'a,'a>
val inline prev : Parser<'a Stream,'a,'a>
module Xml =
open System.Xml.Linq
type E = XElement
type A = XAttribute
type N = string
type V = string
[<AutoOpen>]
module Operators =
val inline ( !> ) : ^b -> ^a when ^a : (static member op_Implicit : ^b -> ^a)
val inline ( ~~ ) : string -> bool
val inline ( -?- ) : string -> string -> bool
val inline ( -!- ) : string -> string -> bool
val inline ( @@ ) : E -> N -> A
val inline ( @ ) : E -> N -> V
val inline ( @- ) : E -> N -> bool
val inline ( @+ ) : E -> N -> bool
val inline ( @? ) : E -> N -> V -> bool
val inline ( @! ) : E -> N -> V -> bool
val inline name : ^x -> N when ^x : (member Name : XName)
val inline value : ^x -> V when ^x : (member Value : V)
[<AutoOpen>]
module Parsers =
val inline ( !<> ) : N -> Parser<'s,E,E>
val inline ( !@@ ) : N -> Parser<'s,E,A>
val inline ( !@ ) : N -> Parser<'s,E,V>
val inline ( !@- ) : N -> Parser<'s,E,unit>
val inline ( !@+ ) : N -> Parser<'s,E,unit>
val inline ( @~? ) : N -> V -> Parser<'s,E,unit>
val inline ( @~! ) : N -> V -> Parser<'s,E,unit>
[<AutoOpen>]
module Navigation =
type XElement with
member NextElement : E
member PreviousElement : E
member inline Child : E
static member inline source : E -> Source<E,E>
val next : Parser<E,E,E>
val prev : Parser<E,E,E>
val parent : Parser<E,E,E>
val child : Parser<E,E,E>
[<AutoOpen>]
module Parsers =
val inline children : Parser<E,E,'b> -> Parser<E,E,'b list>