]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G16.expected.txt
machine: make failure be minReads=0
[haskell/symantic-parser.git] / test / Golden / Splice / G16.expected.txt
1 \(input_0 :: inp_6989586621679040759) ->
2 let !(#
3 init_1,
4 readMore_2,
5 readNext_3
6 #) =
7 let _ = "cursorOf"
8 in let next_4
9 ( t_5@( Data.Text.Internal.Text
10 arr_6
11 off_7
12 unconsumed_8
13 )
14 ) =
15 let !( Data.Text.Unsafe.Iter
16 c_9
17 d_10
18 ) = Data.Text.Unsafe.iter t_5 0
19 in (#
20 c_9,
21 Data.Text.Internal.Text arr_6 (off_7 GHC.Num.+ d_10) (unconsumed_8 GHC.Num.- d_10)
22 #)
23 more_11
24 ( Data.Text.Internal.Text
25 _
26 _
27 unconsumed_12
28 ) = unconsumed_12 GHC.Classes.> 0
29 in (#
30 input_0,
31 more_11,
32 next_4
33 #)
34 finalRet_13 = \_farInp_14 _farExp_15 v_16 _inp_17 -> Symantic.Parser.Machine.Generate.returnST GHC.Base.$ Data.Either.Right v_16
35 finalRaise_18 ::
36 forall st_19 b_20.
37 Symantic.Parser.Machine.Generate.Catcher
38 st_19
39 inp_6989586621679040759
40 b_20 = \(!exn_21) _failInp_22 (!farInp_23) (!farExp_24) ->
41 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
42 Data.Either.Left
43 Symantic.Parser.Machine.Generate.ParsingError
44 { Symantic.Parser.Machine.Generate.parsingErrorOffset = Symantic.Parser.Machine.Input.offset farInp_23,
45 Symantic.Parser.Machine.Generate.parsingErrorException = exn_21,
46 Symantic.Parser.Machine.Generate.parsingErrorUnexpected =
47 if readMore_2 farInp_23
48 then
49 GHC.Maybe.Just
50 ( let (#
51 c_25,
52 _
53 #) = readNext_3 farInp_23
54 in c_25
55 )
56 else GHC.Maybe.Nothing,
57 Symantic.Parser.Machine.Generate.parsingErrorExpecting =
58 let ( minHoriz_26,
59 res_27
60 ) =
61 Data.Set.Internal.foldr
62 ( \f_28
63 ( minH_29,
64 acc_30
65 ) -> case Symantic.Parser.Grammar.Combinators.unSomeFailure f_28 of
66 GHC.Maybe.Just (Symantic.Parser.Grammar.Combinators.FailureHorizon h_31 :: Symantic.Parser.Grammar.Combinators.Failure (Symantic.Parser.Grammar.Combinators.CombSatisfiable (Symantic.Parser.Machine.Input.InputToken inp_6989586621679040759)))
67 | GHC.Maybe.Just old_32 <- minH_29 ->
68 ( GHC.Maybe.Just (GHC.Classes.min old_32 h_31),
69 acc_30
70 )
71 | GHC.Base.otherwise ->
72 ( GHC.Maybe.Just h_31,
73 acc_30
74 )
75 _ ->
76 ( minH_29,
77 f_28 GHC.Types.: acc_30
78 )
79 )
80 ( GHC.Maybe.Nothing,
81 GHC.Types . []
82 )
83 farExp_24
84 in Data.Set.Internal.fromList GHC.Base.$
85 ( case minHoriz_26 of
86 GHC.Maybe.Just h_33 -> Symantic.Parser.Grammar.Combinators.SomeFailure (Symantic.Parser.Grammar.Combinators.FailureHorizon @(Symantic.Parser.Machine.Input.InputToken inp_6989586621679040759) h_33) GHC.Types.: res_27
87 GHC.Maybe.Nothing -> res_27
88 )
89 }
90 in GHC.ST.runST
91 ( let inputToken = Data.Proxy.Proxy :: Data.Proxy.Proxy (Symantic.Parser.Machine.Input.InputToken inp_6989586621679040759)
92 in let _ = "checkHorizon.noCheck"
93 in let
94 in let _ = "pushValue"
95 in let join_34 = \farInp_35 farExp_36 v_37 (!inp_38) ->
96 let _ = "comment: satisfy"
97 in let inp_39 = inp_38
98 in let readFail_40 = finalRaise_18
99 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=1"
100 in if readMore_2 inp_39
101 then
102 let _ = "checkToken"
103 in let !(#
104 c_41,
105 cs_42
106 #) = readNext_3 inp_39
107 in if (GHC.Classes.==) 'd' c_41
108 then
109 let _ = "resume"
110 in finalRet_13
111 farInp_35
112 farExp_36
113 ( let _ = "resume.genCode"
114 in GHC.Show.show v_37
115 )
116 cs_42
117 else
118 let _ = "checkToken.fail"
119 in let failExp_43 =
120 Data.Set.Internal.Bin
121 1
122 ( Symantic.Parser.Grammar.Combinators.SomeFailure
123 ( case inputToken of
124 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'd'
125 )
126 )
127 Data.Set.Internal.Tip
128 Data.Set.Internal.Tip
129 in let (#
130 farInp_44,
131 farExp_45
132 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_35 inp_39 of
133 GHC.Types.LT ->
134 (#
135 inp_39,
136 failExp_43
137 #)
138 GHC.Types.EQ ->
139 (#
140 farInp_35,
141 failExp_43 GHC.Base.<> farExp_36
142 #)
143 GHC.Types.GT ->
144 (#
145 farInp_35,
146 farExp_36
147 #)
148 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_39 farInp_44 farExp_45
149 else
150 let _ = "checkHorizon.newCheck.fail"
151 in let failExp_46 =
152 Data.Set.Internal.Bin
153 1
154 ( Symantic.Parser.Grammar.Combinators.SomeFailure
155 ( case inputToken of
156 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok'_6989586621679080671 1
157 )
158 )
159 Data.Set.Internal.Tip
160 Data.Set.Internal.Tip
161 in let (#
162 farInp_47,
163 farExp_48
164 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_35 inp_39 of
165 GHC.Types.LT ->
166 (#
167 inp_39,
168 failExp_46
169 #)
170 GHC.Types.EQ ->
171 (#
172 farInp_35,
173 failExp_46 GHC.Base.<> farExp_36
174 #)
175 GHC.Types.GT ->
176 (#
177 farInp_35,
178 farExp_36
179 #)
180 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_39 farInp_47 farExp_48
181 in let _ = "catch ExceptionFailure"
182 in let catchHandler_49 (!_exn_50) (!failInp_51) (!farInp_52) (!farExp_53) =
183 let _ = "catch.ko ExceptionFailure"
184 in let _ = "pushInput"
185 in if ( \( Data.Text.Internal.Text
186 _
187 i_54
188 _
189 )
190 ( Data.Text.Internal.Text
191 _
192 j_55
193 _
194 ) -> i_54 GHC.Classes.== j_55
195 )
196 init_1
197 failInp_51
198 then
199 let _ = "choicesBranch.then"
200 in let _ = "catch ExceptionFailure"
201 in let catchHandler_56 (!_exn_57) (!failInp_58) (!farInp_59) (!farExp_60) =
202 let _ = "catch.ko ExceptionFailure"
203 in let _ = "pushInput"
204 in if ( \( Data.Text.Internal.Text
205 _
206 i_61
207 _
208 )
209 ( Data.Text.Internal.Text
210 _
211 j_62
212 _
213 ) -> i_61 GHC.Classes.== j_62
214 )
215 failInp_51
216 failInp_58
217 then
218 let _ = "choicesBranch.then"
219 in let _ = "pushValue"
220 in let _ = "comment: satisfy"
221 in let inp_63 = failInp_58
222 in let readFail_64 = finalRaise_18
223 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=2"
224 in if readMore_2 (Symantic.Parser.Machine.Input.shiftRightText 1 inp_63)
225 then
226 let _ = "checkToken"
227 in let !(#
228 c_65,
229 cs_66
230 #) = readNext_3 inp_63
231 in if (GHC.Classes.==) 'c' c_65
232 then
233 let _ = "resume"
234 in join_34
235 farInp_59
236 farExp_60
237 ( let _ = "resume.genCode"
238 in 'c'
239 )
240 cs_66
241 else
242 let _ = "checkToken.fail"
243 in let failExp_67 =
244 Data.Set.Internal.Bin
245 1
246 ( Symantic.Parser.Grammar.Combinators.SomeFailure
247 ( case inputToken of
248 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'c'
249 )
250 )
251 Data.Set.Internal.Tip
252 Data.Set.Internal.Tip
253 in let (#
254 farInp_68,
255 farExp_69
256 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_59 inp_63 of
257 GHC.Types.LT ->
258 (#
259 inp_63,
260 failExp_67
261 #)
262 GHC.Types.EQ ->
263 (#
264 farInp_59,
265 failExp_67 GHC.Base.<> farExp_60
266 #)
267 GHC.Types.GT ->
268 (#
269 farInp_59,
270 farExp_60
271 #)
272 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_63 farInp_68 farExp_69
273 else
274 let _ = "checkHorizon.newCheck.fail"
275 in let failExp_70 =
276 Data.Set.Internal.Bin
277 1
278 ( Symantic.Parser.Grammar.Combinators.SomeFailure
279 ( case inputToken of
280 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok'_6989586621679080671 2
281 )
282 )
283 Data.Set.Internal.Tip
284 Data.Set.Internal.Tip
285 in let (#
286 farInp_71,
287 farExp_72
288 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_59 inp_63 of
289 GHC.Types.LT ->
290 (#
291 inp_63,
292 failExp_70
293 #)
294 GHC.Types.EQ ->
295 (#
296 farInp_59,
297 failExp_70 GHC.Base.<> farExp_60
298 #)
299 GHC.Types.GT ->
300 (#
301 farInp_59,
302 farExp_60
303 #)
304 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_63 farInp_71 farExp_72
305 else
306 let _ = "choicesBranch.else"
307 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp_58 farInp_59 farExp_60
308 in let _ = "pushValue"
309 in let _ = "comment: satisfy"
310 in let inp_73 = failInp_51
311 in let readFail_74 = catchHandler_56
312 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=2"
313 in if readMore_2 (Symantic.Parser.Machine.Input.shiftRightText 1 inp_73)
314 then
315 let _ = "checkToken"
316 in let !(#
317 c_75,
318 cs_76
319 #) = readNext_3 inp_73
320 in if (GHC.Classes.==) 'b' c_75
321 then
322 let _ = "commit"
323 in let _ = "resume"
324 in join_34
325 farInp_52
326 farExp_53
327 ( let _ = "resume.genCode"
328 in 'b'
329 )
330 cs_76
331 else
332 let _ = "checkToken.fail"
333 in let failExp_77 =
334 Data.Set.Internal.Bin
335 1
336 ( Symantic.Parser.Grammar.Combinators.SomeFailure
337 ( case inputToken of
338 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'b'
339 )
340 )
341 Data.Set.Internal.Tip
342 Data.Set.Internal.Tip
343 in let (#
344 farInp_78,
345 farExp_79
346 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_52 inp_73 of
347 GHC.Types.LT ->
348 (#
349 inp_73,
350 failExp_77
351 #)
352 GHC.Types.EQ ->
353 (#
354 farInp_52,
355 failExp_77 GHC.Base.<> farExp_53
356 #)
357 GHC.Types.GT ->
358 (#
359 farInp_52,
360 farExp_53
361 #)
362 in readFail_74 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_73 farInp_78 farExp_79
363 else
364 let _ = "checkHorizon.newCheck.fail"
365 in let failExp_80 =
366 Data.Set.Internal.Bin
367 1
368 ( Symantic.Parser.Grammar.Combinators.SomeFailure
369 ( case inputToken of
370 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok'_6989586621679080671 2
371 )
372 )
373 Data.Set.Internal.Tip
374 Data.Set.Internal.Tip
375 in let (#
376 farInp_81,
377 farExp_82
378 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_52 inp_73 of
379 GHC.Types.LT ->
380 (#
381 inp_73,
382 failExp_80
383 #)
384 GHC.Types.EQ ->
385 (#
386 farInp_52,
387 failExp_80 GHC.Base.<> farExp_53
388 #)
389 GHC.Types.GT ->
390 (#
391 farInp_52,
392 farExp_53
393 #)
394 in readFail_74 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_73 farInp_81 farExp_82
395 else
396 let _ = "choicesBranch.else"
397 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp_51 farInp_52 farExp_53
398 in let _ = "pushValue"
399 in let _ = "comment: satisfy"
400 in let inp_83 = init_1
401 in let readFail_84 = catchHandler_49
402 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=2"
403 in if readMore_2 (Symantic.Parser.Machine.Input.shiftRightText 1 inp_83)
404 then
405 let _ = "checkToken"
406 in let !(#
407 c_85,
408 cs_86
409 #) = readNext_3 inp_83
410 in if (GHC.Classes.==) 'a' c_85
411 then
412 let _ = "commit"
413 in let _ = "resume"
414 in join_34
415 init_1
416 Data.Set.Internal.empty
417 ( let _ = "resume.genCode"
418 in 'a'
419 )
420 cs_86
421 else
422 let _ = "checkToken.fail"
423 in let failExp_87 =
424 Data.Set.Internal.Bin
425 1
426 ( Symantic.Parser.Grammar.Combinators.SomeFailure
427 ( case inputToken of
428 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
429 )
430 )
431 Data.Set.Internal.Tip
432 Data.Set.Internal.Tip
433 in let (#
434 farInp_88,
435 farExp_89
436 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 inp_83 of
437 GHC.Types.LT ->
438 (#
439 inp_83,
440 failExp_87
441 #)
442 GHC.Types.EQ ->
443 (#
444 init_1,
445 failExp_87 GHC.Base.<> Data.Set.Internal.empty
446 #)
447 GHC.Types.GT ->
448 (#
449 init_1,
450 Data.Set.Internal.empty
451 #)
452 in readFail_84 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_83 farInp_88 farExp_89
453 else
454 let _ = "checkHorizon.newCheck.fail"
455 in let failExp_90 =
456 Data.Set.Internal.Bin
457 1
458 ( Symantic.Parser.Grammar.Combinators.SomeFailure
459 ( case inputToken of
460 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok'_6989586621679080671 2
461 )
462 )
463 Data.Set.Internal.Tip
464 Data.Set.Internal.Tip
465 in let (#
466 farInp_91,
467 farExp_92
468 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 inp_83 of
469 GHC.Types.LT ->
470 (#
471 inp_83,
472 failExp_90
473 #)
474 GHC.Types.EQ ->
475 (#
476 init_1,
477 failExp_90 GHC.Base.<> Data.Set.Internal.empty
478 #)
479 GHC.Types.GT ->
480 (#
481 init_1,
482 Data.Set.Internal.empty
483 #)
484 in readFail_84 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_83 farInp_91 farExp_92
485 )