]> Git — Sourcephile - haskell/symantic-parser.git/blob - tests/Golden/Splice/G20.expected.txt
iface: update release `version`
[haskell/symantic-parser.git] / tests / Golden / Splice / G20.expected.txt
1 \(input :: inp) ->
2 let !(#
3 init,
4 readMore,
5 readNext
6 #) =
7 let _ = "cursorOf"
8 in let next
9 ( t@( Data.Text.Internal.Text
10 arr
11 off
12 unconsumed
13 )
14 ) =
15 let !( Data.Text.Unsafe.Iter
16 c
17 d
18 ) = Data.Text.Unsafe.iter t 0
19 in (#
20 c,
21 Data.Text.Internal.Text arr (off GHC.Num.+ d) (unconsumed GHC.Num.- d)
22 #)
23 more
24 ( Data.Text.Internal.Text
25 _
26 _
27 unconsumed
28 ) = unconsumed GHC.Classes.> 0
29 in (# input, more, next #)
30 finalRet = \_farInp _farExp v _inp -> Symantic.Parser.Machine.Generate.returnST GHC.Base.$ Data.Either.Right v
31 finalRaise ::
32 forall st b.
33 Symantic.Parser.Machine.Generate.OnException
34 st
35 inp
36 b = \(!exn) _failInp (!farInp) (!farExp) ->
37 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
38 Data.Either.Left
39 Symantic.Parser.Machine.Generate.ParsingError
40 { Symantic.Parser.Machine.Generate.parsingErrorOffset = Symantic.Parser.Machine.Input.offset farInp,
41 Symantic.Parser.Machine.Generate.parsingErrorException = exn,
42 Symantic.Parser.Machine.Generate.parsingErrorUnexpected =
43 if readMore farInp
44 then
45 GHC.Maybe.Just
46 ( let (#
47 c,
48 _
49 #) = readNext farInp
50 in c
51 )
52 else GHC.Maybe.Nothing,
53 Symantic.Parser.Machine.Generate.parsingErrorExpecting =
54 let ( minHoriz,
55 res
56 ) =
57 Data.Set.Internal.foldr
58 ( \f
59 ( minH,
60 acc
61 ) -> case Symantic.Parser.Grammar.Combinators.unSomeFailure f of
62 GHC.Maybe.Just (Symantic.Parser.Grammar.Combinators.FailureHorizon h :: Symantic.Parser.Grammar.Combinators.Failure (Symantic.Parser.Grammar.Combinators.CombSatisfiable (Symantic.Parser.Machine.Input.InputToken inp)))
63 | GHC.Maybe.Just old <- minH ->
64 ( GHC.Maybe.Just (GHC.Classes.min old h),
65 acc
66 )
67 | GHC.Base.otherwise ->
68 ( GHC.Maybe.Just h,
69 acc
70 )
71 _ ->
72 ( minH,
73 f GHC.Types.: acc
74 )
75 )
76 ( GHC.Maybe.Nothing,
77 GHC.Types . []
78 )
79 farExp
80 in Data.Set.Internal.fromList GHC.Base.$
81 ( case minHoriz of
82 GHC.Maybe.Just h -> Symantic.Parser.Grammar.Combinators.SomeFailure (Symantic.Parser.Grammar.Combinators.FailureHorizon @(Symantic.Parser.Machine.Input.InputToken inp) h) GHC.Types.: res
83 GHC.Maybe.Nothing -> res
84 )
85 }
86 in GHC.ST.runST
87 ( let inputToken = Data.Proxy.Proxy :: Data.Proxy.Proxy (Symantic.Parser.Machine.Input.InputToken inp)
88 in let inp = init
89 in let readFail = finalRaise
90 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=3"
91 in if readMore (Symantic.Parser.Machine.Input.shiftRightText 2 inp)
92 then
93 let
94 in let _ = "pushValue"
95 in let join = \farInp farExp v (!inp) ->
96 let _ = "lift2Value checkedHorizon=0"
97 in let _ = "catch ExceptionFailure checkedHorizon=0"
98 in let onException =
99 let _ = "onException"
100 in \(!_exn) (!failInp) (!farInp) (!farExp) ->
101 let _ = "loadInput checkedHorizon=0"
102 in let _ = "checkHorizon.noCheck"
103 in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure inp farInp farExp
104 in let _ = "pushValue"
105 in let _ = "comment: satisfy ((GHC.Classes.==) 'd')"
106 in let inp = inp
107 in let readFail = onException
108 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=3"
109 in if readMore (Symantic.Parser.Machine.Input.shiftRightText 2 inp)
110 then
111 let _ = "checkToken"
112 in let !(#
113 c,
114 cs
115 #) = readNext inp
116 in if (GHC.Classes.==) 'd' c
117 then
118 let _ = "lift2Value checkedHorizon=3"
119 in let _ = "comment: satisfy ((GHC.Classes.==) 'e')"
120 in let _ = "checkHorizon.oldCheck: checkedHorizon=3"
121 in let _ = "checkToken"
122 in let !(#
123 c,
124 cs
125 #) = readNext cs
126 in if (GHC.Classes.==) 'e' c
127 then
128 let _ = "lift2Value checkedHorizon=2"
129 in let _ = "comment: satisfy ((GHC.Classes.==) 'f')"
130 in let _ = "checkHorizon.oldCheck: checkedHorizon=2"
131 in let _ = "checkToken"
132 in let !(#
133 c,
134 cs
135 #) = readNext cs
136 in if (GHC.Classes.==) 'f' c
137 then
138 let _ = "lift2Value checkedHorizon=1"
139 in let _ = "commit"
140 in let _ = "lift2Value checkedHorizon=1"
141 in let _ = "resume"
142 in finalRet
143 farInp
144 farExp
145 ( let _ = "resume.genCode"
146 in GHC.Show.show GHC.Tuple . ()
147 )
148 cs
149 else
150 let _ = "checkToken.fail"
151 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure cs farInp farExp
152 else
153 let _ = "checkToken.fail"
154 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure cs farInp farExp
155 else
156 let _ = "checkToken.fail"
157 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure inp farInp farExp
158 else
159 let _ = "checkHorizon.newCheck.fail"
160 in let failExp =
161 Data.Set.Internal.Bin
162 1
163 ( Symantic.Parser.Grammar.Combinators.SomeFailure
164 ( case inputToken of
165 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 3
166 )
167 )
168 Data.Set.Internal.Tip
169 Data.Set.Internal.Tip
170 in let (#
171 farInp,
172 farExp
173 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp inp of
174 GHC.Types.LT ->
175 (#
176 inp,
177 failExp
178 #)
179 GHC.Types.EQ ->
180 (#
181 farInp,
182 failExp GHC.Base.<> farExp
183 #)
184 GHC.Types.GT ->
185 (#
186 farInp,
187 farExp
188 #)
189 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure inp farInp farExp
190 in let _ = "catch ExceptionFailure checkedHorizon=3"
191 in let onException =
192 let _ = "onException"
193 in \(!_exn) (!failInp) (!farInp) (!farExp) ->
194 let _ = "comment: raiseAgainIfConsumed"
195 in let _ = "saveInput checkedHorizon=0"
196 in let _ = "lift2Value checkedHorizon=0"
197 in if ( \( Data.Text.Internal.Text
198 _
199 i
200 _
201 )
202 ( Data.Text.Internal.Text
203 _
204 j
205 _
206 ) -> i GHC.Classes.== j
207 )
208 inp
209 failInp
210 then
211 let _ = "choicesBranch checkedHorizon=0"
212 in let _ = "catch ExceptionFailure checkedHorizon=0"
213 in let onException =
214 let _ = "onException"
215 in \(!_exn) (!failInp) (!farInp) (!farExp) ->
216 let _ = "loadInput checkedHorizon=0"
217 in let _ = "checkHorizon.noCheck"
218 in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp
219 in let _ = "pushValue"
220 in let _ = "commit"
221 in let _ = "resume"
222 in join
223 farInp
224 farExp
225 ( let _ = "resume.genCode"
226 in GHC.Types . []
227 )
228 failInp
229 else
230 let _ = "choicesBranch.else"
231 in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp
232 in let _ = "catch ExceptionFailure checkedHorizon=3"
233 in let onException =
234 let _ = "onException"
235 in \(!_exn) (!failInp) (!farInp) (!farExp) ->
236 let _ = "loadInput checkedHorizon=3"
237 in let _ = "checkHorizon.oldCheck: checkedHorizon=3"
238 in onException Symantic.Parser.Grammar.Combinators.ExceptionFailure inp farInp farExp
239 in let _ = "pushValue"
240 in let _ = "comment: satisfy ((GHC.Classes.==) 'a')"
241 in let _ = "checkHorizon.oldCheck: checkedHorizon=3"
242 in let _ = "checkToken"
243 in let !(#
244 c,
245 cs
246 #) = readNext inp
247 in if (GHC.Classes.==) 'a' c
248 then
249 let _ = "lift2Value checkedHorizon=2"
250 in let _ = "comment: satisfy ((GHC.Classes.==) 'b')"
251 in let _ = "checkHorizon.oldCheck: checkedHorizon=2"
252 in let _ = "checkToken"
253 in let !(#
254 c,
255 cs
256 #) = readNext cs
257 in if (GHC.Classes.==) 'b' c
258 then
259 let _ = "lift2Value checkedHorizon=1"
260 in let _ = "comment: satisfy ((GHC.Classes.==) 'c')"
261 in let _ = "checkHorizon.oldCheck: checkedHorizon=1"
262 in let _ = "checkToken"
263 in let !(#
264 c,
265 cs
266 #) = readNext cs
267 in if (GHC.Classes.==) 'c' c
268 then
269 let _ = "lift2Value checkedHorizon=0"
270 in let _ = "commit"
271 in let _ = "commit"
272 in let _ = "resume"
273 in join
274 init
275 Data.Set.Internal.empty
276 ( let _ = "resume.genCode"
277 in (GHC.Types.:) 'a' ((GHC.Types.:) 'b' ((GHC.Types.:) 'c' GHC.Types . []))
278 )
279 cs
280 else
281 let _ = "checkToken.fail"
282 in onException Symantic.Parser.Grammar.Combinators.ExceptionFailure cs init Data.Set.Internal.empty
283 else
284 let _ = "checkToken.fail"
285 in onException Symantic.Parser.Grammar.Combinators.ExceptionFailure cs init Data.Set.Internal.empty
286 else
287 let _ = "checkToken.fail"
288 in onException Symantic.Parser.Grammar.Combinators.ExceptionFailure inp init Data.Set.Internal.empty
289 else
290 let _ = "checkHorizon.newCheck.fail"
291 in let failExp =
292 Data.Set.Internal.Bin
293 1
294 ( Symantic.Parser.Grammar.Combinators.SomeFailure
295 ( case inputToken of
296 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 3
297 )
298 )
299 Data.Set.Internal.Tip
300 Data.Set.Internal.Tip
301 in let (#
302 farInp,
303 farExp
304 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init inp of
305 GHC.Types.LT ->
306 (#
307 inp,
308 failExp
309 #)
310 GHC.Types.EQ ->
311 (#
312 init,
313 failExp GHC.Base.<> Data.Set.Internal.empty
314 #)
315 GHC.Types.GT ->
316 (#
317 init,
318 Data.Set.Internal.empty
319 #)
320 in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure inp farInp farExp
321 )