-
Notifications
You must be signed in to change notification settings - Fork 1
/
CorePattern.mli
142 lines (113 loc) · 4.07 KB
/
CorePattern.mli
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
130
131
132
133
134
135
136
137
138
139
140
141
142
(* val ignore : 'a -> unit *)
type uset = CamomileLibrary.USet.t
val sexp_of_uset : CamomileLibrary.USet.t -> Sexplib.Sexp.t
val uset_of_sexp : Sexplib.Sexp.t -> CamomileLibrary.USet.t
val all_unicode : CamomileLibrary.USet.t
(* val take_append : int -> 'a list -> 'a list -> 'a list *)
val liftOpt : ('a -> 'b -> 'c) -> 'a option -> 'b option -> 'c option
val pureRepeatOnto : 'a list -> 'a -> int -> 'a list
val thunkRepeatOnto : 'a list -> (unit -> 'a) -> int -> 'a list
type handleTag = NoTag | Advice of Common.tag | Apply of Common.tag
val handleTag_of_sexp__ : Sexplib.Sexp.t -> handleTag
val handleTag_of_sexp : Sexplib.Sexp.t -> handleTag
val sexp_of_handleTag : handleTag -> Sexplib.Sexp.t
val seeht : handleTag -> string
val apply : handleTag -> Common.tag option
val asAdvice : handleTag -> handleTag
val toUpdate : handleTag -> (Common.tag * Common.tagTask) list
type corePattern =
Or of coreQ list
| Seq of coreQ * coreQ
| Repeat of repeatQ
| Test of WhichTest.testSet
| OneChar of uset * Common.patIndex
| CaptureGroup of capGroupQ
and capGroupQ = {
parentGroup : Common.groupIndex;
myGroup : Common.groupIndex;
mutable preReset : Common.tag list;
mutable postSet : Common.tag;
subPat : coreQ;
}
and repeatQ = {
lowBound : int;
optHiBound : int option;
topCount : int;
repDepth : int;
needsOrbit : bool;
mutable getOrbit : (Common.tag * Common.orbit) option;
mutable resetOrbits : (Common.tag * Common.orbit) list;
mutable mostLoops : int;
repAt : Common.patIndex;
unRep : coreQ;
}
and contSpec = HowReturn of coreQ | HowReturnMidSeq of coreQ | HowRoot
and coreQ = {
takes : int * int option;
childGroups : bool;
tagged : bool;
wants : Common.wanted;
mutable preTag : Common.tag option;
mutable postTag : Common.tag option;
mutable nullQ : WhichTest.nullView;
mutable contTo : contSpec;
unQ : corePattern;
}
val corePattern_of_sexp__ : Sexplib.Sexp.t -> corePattern
val corePattern_of_sexp : Sexplib.Sexp.t -> corePattern
val capGroupQ_of_sexp__ : Sexplib.Sexp.t -> capGroupQ
val capGroupQ_of_sexp : Sexplib.Sexp.t -> capGroupQ
val repeatQ_of_sexp__ : Sexplib.Sexp.t -> repeatQ
val repeatQ_of_sexp : Sexplib.Sexp.t -> repeatQ
val contSpec_of_sexp__ : Sexplib.Sexp.t -> contSpec
val contSpec_of_sexp : Sexplib.Sexp.t -> contSpec
val coreQ_of_sexp__ : Sexplib.Sexp.t -> coreQ
val coreQ_of_sexp : Sexplib.Sexp.t -> coreQ
val sexp_of_corePattern : corePattern -> Sexplib.Sexp.t
val sexp_of_capGroupQ : capGroupQ -> Sexplib.Sexp.t
val sexp_of_repeatQ : repeatQ -> Sexplib.Sexp.t
val sexp_of_contSpec : contSpec -> Sexplib.Sexp.t
val sexp_of_coreQ : coreQ -> Sexplib.Sexp.t
val nothing : coreQ
val epsilon : coreQ
type groupInfo = {
parentIndex : Common.groupIndex;
thisIndex : Common.groupIndex;
startTag : Common.tag;
stopTag : Common.tag;
flagTag : Common.tag;
}
val groupInfo_of_sexp__ : Sexplib.Sexp.t -> groupInfo
val groupInfo_of_sexp : Sexplib.Sexp.t -> groupInfo
val sexp_of_groupInfo : groupInfo -> Sexplib.Sexp.t
type coreResult = {
cp : coreQ;
tags : Common.tagOP array;
groups : groupInfo array;
orbitCount : int;
depthCount : int;
}
val coreResult_of_sexp__ : Sexplib.Sexp.t -> coreResult
val coreResult_of_sexp : Sexplib.Sexp.t -> coreResult
val sexp_of_coreResult : coreResult -> Sexplib.Sexp.t
val varies : 'a * 'a option -> bool
val toUSet : Pattern.bracketPiece list -> CamomileLibrary.USet.t
val cannotTake : coreQ -> bool
val addGroupResetsToNullView :
Common.tag list ->
Common.tag -> ('a * Common.taskList) list -> ('a * Common.taskList) list
val cleanNullView : WhichTest.nullView -> WhichTest.nullView
val seqNullViews :
WhichTest.nullView -> WhichTest.nullView -> WhichTest.nullView
val tagWrapNullView :
handleTag ->
handleTag -> ('a * Common.taskList) list -> ('a * Common.taskList) list
val orbitWrapNullView :
repeatQ ->
(Common.rep * Common.orbit) option ->
(Common.rep * Common.orbit) list ->
('a * Common.taskList) list -> ('a * Common.taskList) list
type appliedBoth = AppliedBoth
val toCorePattern : Pattern.pattern -> coreResult
val kick : ReadPattern.ustring -> unit
val test : unit -> unit