]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G18.expected.txt
machine: make failure be minReads=0
[haskell/symantic-parser.git] / test / Golden / Splice / G18.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 _ = "resume"
97 in finalRet_13
98 farInp_35
99 farExp_36
100 ( let _ = "resume.genCode"
101 in GHC.Show.show v_37
102 )
103 inp_38
104 in let _ = "catch ExceptionFailure"
105 in let catchHandler_39 (!_exn_40) (!failInp_41) (!farInp_42) (!farExp_43) =
106 let _ = "catch.ko ExceptionFailure"
107 in let _ = "pushInput"
108 in if ( \( Data.Text.Internal.Text
109 _
110 i_44
111 _
112 )
113 ( Data.Text.Internal.Text
114 _
115 j_45
116 _
117 ) -> i_44 GHC.Classes.== j_45
118 )
119 init_1
120 failInp_41
121 then
122 let _ = "choicesBranch.then"
123 in let _ = "catch ExceptionFailure"
124 in let catchHandler_46 (!_exn_47) (!failInp_48) (!farInp_49) (!farExp_50) =
125 let _ = "catch.ko ExceptionFailure"
126 in let _ = "loadInput"
127 in let _ = "checkHorizon.noCheck"
128 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp_41 farInp_49 farExp_50
129 in let _ = "pushValue"
130 in let _ = "comment: satisfy"
131 in let inp_51 = failInp_41
132 in let readFail_52 = catchHandler_46
133 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=2"
134 in if readMore_2 (Symantic.Parser.Machine.Input.shiftRightText 1 inp_51)
135 then
136 let _ = "checkToken"
137 in let !(#
138 c_53,
139 cs_54
140 #) = readNext_3 inp_51
141 in if (GHC.Classes.==) 'd' c_53
142 then
143 let _ = "comment: satisfy"
144 in let _ = "checkHorizon.oldCheck: checkedHorizon=2"
145 in let _ = "checkToken"
146 in let !(#
147 c_55,
148 cs_56
149 #) = readNext_3 cs_54
150 in if (GHC.Classes.==) 'e' c_55
151 then
152 let _ = "commit"
153 in let _ = "resume"
154 in join_34
155 farInp_42
156 farExp_43
157 ( let _ = "resume.genCode"
158 in (GHC.Types.:) 'd' ((GHC.Types.:) 'e' GHC.Types . [])
159 )
160 cs_56
161 else
162 let _ = "checkToken.fail"
163 in let failExp_57 =
164 Data.Set.Internal.Bin
165 1
166 ( Symantic.Parser.Grammar.Combinators.SomeFailure
167 ( case inputToken of
168 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'e'
169 )
170 )
171 Data.Set.Internal.Tip
172 Data.Set.Internal.Tip
173 in let (#
174 farInp_58,
175 farExp_59
176 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_42 cs_54 of
177 GHC.Types.LT ->
178 (#
179 cs_54,
180 failExp_57
181 #)
182 GHC.Types.EQ ->
183 (#
184 farInp_42,
185 failExp_57 GHC.Base.<> farExp_43
186 #)
187 GHC.Types.GT ->
188 (#
189 farInp_42,
190 farExp_43
191 #)
192 in readFail_52 Symantic.Parser.Grammar.Combinators.ExceptionFailure cs_54 farInp_58 farExp_59
193 else
194 let _ = "checkToken.fail"
195 in let failExp_60 =
196 Data.Set.Internal.Bin
197 1
198 ( Symantic.Parser.Grammar.Combinators.SomeFailure
199 ( case inputToken of
200 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'd'
201 )
202 )
203 Data.Set.Internal.Tip
204 Data.Set.Internal.Tip
205 in let (#
206 farInp_61,
207 farExp_62
208 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_42 inp_51 of
209 GHC.Types.LT ->
210 (#
211 inp_51,
212 failExp_60
213 #)
214 GHC.Types.EQ ->
215 (#
216 farInp_42,
217 failExp_60 GHC.Base.<> farExp_43
218 #)
219 GHC.Types.GT ->
220 (#
221 farInp_42,
222 farExp_43
223 #)
224 in readFail_52 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_51 farInp_61 farExp_62
225 else
226 let _ = "checkHorizon.newCheck.fail"
227 in let failExp_63 =
228 Data.Set.Internal.Bin
229 1
230 ( Symantic.Parser.Grammar.Combinators.SomeFailure
231 ( case inputToken of
232 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok'_6989586621679080671 2
233 )
234 )
235 Data.Set.Internal.Tip
236 Data.Set.Internal.Tip
237 in let (#
238 farInp_64,
239 farExp_65
240 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_42 inp_51 of
241 GHC.Types.LT ->
242 (#
243 inp_51,
244 failExp_63
245 #)
246 GHC.Types.EQ ->
247 (#
248 farInp_42,
249 failExp_63 GHC.Base.<> farExp_43
250 #)
251 GHC.Types.GT ->
252 (#
253 farInp_42,
254 farExp_43
255 #)
256 in readFail_52 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_51 farInp_64 farExp_65
257 else
258 let _ = "choicesBranch.else"
259 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp_41 farInp_42 farExp_43
260 in let _ = "catch ExceptionFailure"
261 in let catchHandler_66 (!_exn_67) (!failInp_68) (!farInp_69) (!farExp_70) =
262 let _ = "catch.ko ExceptionFailure"
263 in let _ = "loadInput"
264 in let _ = "checkHorizon.noCheck"
265 in catchHandler_39 Symantic.Parser.Grammar.Combinators.ExceptionFailure init_1 farInp_69 farExp_70
266 in let _ = "pushValue"
267 in let _ = "comment: satisfy"
268 in let inp_71 = init_1
269 in let readFail_72 = catchHandler_66
270 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=3"
271 in if readMore_2 (Symantic.Parser.Machine.Input.shiftRightText 2 inp_71)
272 then
273 let _ = "checkToken"
274 in let !(#
275 c_73,
276 cs_74
277 #) = readNext_3 inp_71
278 in if (GHC.Classes.==) 'a' c_73
279 then
280 let _ = "comment: satisfy"
281 in let _ = "checkHorizon.oldCheck: checkedHorizon=3"
282 in let _ = "checkToken"
283 in let !(#
284 c_75,
285 cs_76
286 #) = readNext_3 cs_74
287 in if (GHC.Classes.==) 'b' c_75
288 then
289 let _ = "comment: satisfy"
290 in let _ = "checkHorizon.oldCheck: checkedHorizon=2"
291 in let _ = "checkToken"
292 in let !(#
293 c_77,
294 cs_78
295 #) = readNext_3 cs_76
296 in if (GHC.Classes.==) 'c' c_77
297 then
298 let _ = "commit"
299 in let _ = "commit"
300 in let _ = "resume"
301 in join_34
302 init_1
303 Data.Set.Internal.empty
304 ( let _ = "resume.genCode"
305 in (GHC.Types.:) 'a' ((GHC.Types.:) 'b' ((GHC.Types.:) 'c' GHC.Types . []))
306 )
307 cs_78
308 else
309 let _ = "checkToken.fail"
310 in let failExp_79 =
311 Data.Set.Internal.Bin
312 1
313 ( Symantic.Parser.Grammar.Combinators.SomeFailure
314 ( case inputToken of
315 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'c'
316 )
317 )
318 Data.Set.Internal.Tip
319 Data.Set.Internal.Tip
320 in let (#
321 farInp_80,
322 farExp_81
323 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 cs_76 of
324 GHC.Types.LT ->
325 (#
326 cs_76,
327 failExp_79
328 #)
329 GHC.Types.EQ ->
330 (#
331 init_1,
332 failExp_79 GHC.Base.<> Data.Set.Internal.empty
333 #)
334 GHC.Types.GT ->
335 (#
336 init_1,
337 Data.Set.Internal.empty
338 #)
339 in readFail_72 Symantic.Parser.Grammar.Combinators.ExceptionFailure cs_76 farInp_80 farExp_81
340 else
341 let _ = "checkToken.fail"
342 in let failExp_82 =
343 Data.Set.Internal.Bin
344 1
345 ( Symantic.Parser.Grammar.Combinators.SomeFailure
346 ( case inputToken of
347 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'b'
348 )
349 )
350 Data.Set.Internal.Tip
351 Data.Set.Internal.Tip
352 in let (#
353 farInp_83,
354 farExp_84
355 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 cs_74 of
356 GHC.Types.LT ->
357 (#
358 cs_74,
359 failExp_82
360 #)
361 GHC.Types.EQ ->
362 (#
363 init_1,
364 failExp_82 GHC.Base.<> Data.Set.Internal.empty
365 #)
366 GHC.Types.GT ->
367 (#
368 init_1,
369 Data.Set.Internal.empty
370 #)
371 in readFail_72 Symantic.Parser.Grammar.Combinators.ExceptionFailure cs_74 farInp_83 farExp_84
372 else
373 let _ = "checkToken.fail"
374 in let failExp_85 =
375 Data.Set.Internal.Bin
376 1
377 ( Symantic.Parser.Grammar.Combinators.SomeFailure
378 ( case inputToken of
379 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
380 )
381 )
382 Data.Set.Internal.Tip
383 Data.Set.Internal.Tip
384 in let (#
385 farInp_86,
386 farExp_87
387 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 inp_71 of
388 GHC.Types.LT ->
389 (#
390 inp_71,
391 failExp_85
392 #)
393 GHC.Types.EQ ->
394 (#
395 init_1,
396 failExp_85 GHC.Base.<> Data.Set.Internal.empty
397 #)
398 GHC.Types.GT ->
399 (#
400 init_1,
401 Data.Set.Internal.empty
402 #)
403 in readFail_72 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_71 farInp_86 farExp_87
404 else
405 let _ = "checkHorizon.newCheck.fail"
406 in let failExp_88 =
407 Data.Set.Internal.Bin
408 1
409 ( Symantic.Parser.Grammar.Combinators.SomeFailure
410 ( case inputToken of
411 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok'_6989586621679080671 3
412 )
413 )
414 Data.Set.Internal.Tip
415 Data.Set.Internal.Tip
416 in let (#
417 farInp_89,
418 farExp_90
419 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 inp_71 of
420 GHC.Types.LT ->
421 (#
422 inp_71,
423 failExp_88
424 #)
425 GHC.Types.EQ ->
426 (#
427 init_1,
428 failExp_88 GHC.Base.<> Data.Set.Internal.empty
429 #)
430 GHC.Types.GT ->
431 (#
432 init_1,
433 Data.Set.Internal.empty
434 #)
435 in readFail_72 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_71 farInp_89 farExp_90
436 )