]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G5.expected.txt
fix: use a global polyfix for defLet and defRef
[haskell/symantic-parser.git] / test / Golden / Splice / G5.expected.txt
1 \(input_0 :: inp_6989586621679059048) ->
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 in let finalRet_13 = \_farInp_14 _farExp_15 v_16 _inp_17 -> Data.Either.Right v_16
35 in let finalRaise_18 ::
36 forall b_19.
37 Symantic.Parser.Machine.Generate.Catcher
38 inp_6989586621679059048
39 b_19 = \_failInp_20 (!farInp_21) (!farExp_22) ->
40 Data.Either.Left
41 Symantic.Parser.Machine.Generate.ParsingErrorStandard
42 { Symantic.Parser.Machine.Generate.parsingErrorOffset = Symantic.Parser.Machine.Input.offset farInp_21,
43 Symantic.Parser.Machine.Generate.parsingErrorUnexpected =
44 if readMore_2 farInp_21
45 then
46 GHC.Maybe.Just
47 ( let (#
48 c_23,
49 _
50 #) = readNext_3 farInp_21
51 in c_23
52 )
53 else GHC.Maybe.Nothing,
54 Symantic.Parser.Machine.Generate.parsingErrorExpecting = Data.Set.Internal.fromList farExp_22
55 }
56 in let name_24 = \(!ok_25) (!inp_26) (!koByLabel_27) ->
57 let _ = "catchException lbl=fail"
58 in let catchHandler_28 (!failInp_29) (!farInp_30) (!farExp_31) =
59 let _ = "catchException.ko lbl=fail"
60 in let (#
61 farInp_32,
62 farExp_33
63 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_30 inp_26 of
64 GHC.Types.LT ->
65 (#
66 inp_26,
67 []
68 #)
69 GHC.Types.EQ ->
70 (#
71 farInp_30,
72 farExp_31 GHC.Base.<> []
73 #)
74 GHC.Types.GT ->
75 (#
76 farInp_30,
77 farExp_31
78 #)
79 in finalRaise_18 inp_26 farInp_32 farExp_33
80 in let readFail_34 = catchHandler_28
81 in if readMore_2 (Symantic.Parser.Machine.Input.shiftRightText 3 inp_26)
82 then
83 let !(#
84 c_35,
85 cs_36
86 #) = readNext_3 inp_26
87 in if ('a' GHC.Classes.==) c_35
88 then
89 let readFail_37 = readFail_34
90 in let !(#
91 c_38,
92 cs_39
93 #) = readNext_3 cs_36
94 in if ('b' GHC.Classes.==) c_38
95 then
96 let readFail_40 = readFail_34
97 in let !(#
98 c_41,
99 cs_42
100 #) = readNext_3 cs_39
101 in if ('c' GHC.Classes.==) c_41
102 then
103 let readFail_43 = readFail_34
104 in let !(#
105 c_44,
106 cs_45
107 #) = readNext_3 cs_42
108 in if ('d' GHC.Classes.==) c_44
109 then
110 let _ = "resume"
111 in ok_25 init_1 GHC.Types
112 . []
113 ( let _ = "resume.genCode"
114 in 'a' GHC.Types.: ('b' GHC.Types.: ('c' GHC.Types.: ('d' GHC.Types.: GHC.Types . [])))
115 )
116 cs_45
117 else
118 let _ = "checkToken.else"
119 in let (#
120 farInp_46,
121 farExp_47
122 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 cs_42 of
123 GHC.Types.LT ->
124 (#
125 cs_42,
126 [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'd']
127 #)
128 GHC.Types.EQ ->
129 (#
130 init_1,
131 GHC.Types . [] GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'd']
132 #)
133 GHC.Types.GT ->
134 (#
135 init_1,
136 GHC.Types . []
137 #)
138 in readFail_34 cs_42 farInp_46 farExp_47
139 else
140 let _ = "checkToken.else"
141 in let (#
142 farInp_48,
143 farExp_49
144 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 cs_39 of
145 GHC.Types.LT ->
146 (#
147 cs_39,
148 [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'c']
149 #)
150 GHC.Types.EQ ->
151 (#
152 init_1,
153 GHC.Types . [] GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'c']
154 #)
155 GHC.Types.GT ->
156 (#
157 init_1,
158 GHC.Types . []
159 #)
160 in readFail_34 cs_39 farInp_48 farExp_49
161 else
162 let _ = "checkToken.else"
163 in let (#
164 farInp_50,
165 farExp_51
166 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 cs_36 of
167 GHC.Types.LT ->
168 (#
169 cs_36,
170 [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'b']
171 #)
172 GHC.Types.EQ ->
173 (#
174 init_1,
175 GHC.Types . [] GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'b']
176 #)
177 GHC.Types.GT ->
178 (#
179 init_1,
180 GHC.Types . []
181 #)
182 in readFail_34 cs_36 farInp_50 farExp_51
183 else
184 let _ = "checkToken.else"
185 in let (#
186 farInp_52,
187 farExp_53
188 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 inp_26 of
189 GHC.Types.LT ->
190 (#
191 inp_26,
192 [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'a']
193 #)
194 GHC.Types.EQ ->
195 (#
196 init_1,
197 GHC.Types . [] GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'a']
198 #)
199 GHC.Types.GT ->
200 (#
201 init_1,
202 GHC.Types . []
203 #)
204 in readFail_34 inp_26 farInp_52 farExp_53
205 else
206 let _ = "checkHorizon.else"
207 in let (#
208 farInp_54,
209 farExp_55
210 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 inp_26 of
211 GHC.Types.LT ->
212 (#
213 inp_26,
214 [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 4]
215 #)
216 GHC.Types.EQ ->
217 (#
218 init_1,
219 GHC.Types . [] GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 4]
220 #)
221 GHC.Types.GT ->
222 (#
223 init_1,
224 GHC.Types . []
225 #)
226 in readFail_34 inp_26 farInp_54 farExp_55
227 name_56 = \(!ok_57) (!inp_58) (!koByLabel_59) ->
228 let _ = "catchException lbl=fail"
229 in let catchHandler_60 (!failInp_61) (!farInp_62) (!farExp_63) =
230 let _ = "catchException.ko lbl=fail"
231 in if ( \( Data.Text.Internal.Text
232 _
233 i_64
234 _
235 )
236 ( Data.Text.Internal.Text
237 _
238 j_65
239 _
240 ) -> i_64 GHC.Classes.== j_65
241 )
242 inp_58
243 failInp_61
244 then
245 let _ = "choicesBranch.then"
246 in let _ = "resume"
247 in ok_57
248 farInp_62
249 farExp_63
250 ( let _ = "resume.genCode"
251 in \x_66 -> x_66
252 )
253 failInp_61
254 else
255 let _ = "choicesBranch.else"
256 in let (#
257 farInp_67,
258 farExp_68
259 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_62 failInp_61 of
260 GHC.Types.LT ->
261 (#
262 failInp_61,
263 []
264 #)
265 GHC.Types.EQ ->
266 (#
267 farInp_62,
268 farExp_63 GHC.Base.<> []
269 #)
270 GHC.Types.GT ->
271 (#
272 farInp_62,
273 farExp_63
274 #)
275 in finalRaise_18 failInp_61 farInp_67 farExp_68
276 in name_24
277 ( let _ = "suspend"
278 in \farInp_69 farExp_70 v_71 (!inp_72) ->
279 name_56
280 ( let _ = "suspend"
281 in \farInp_73 farExp_74 v_75 (!inp_76) ->
282 let _ = "resume"
283 in ok_57
284 farInp_73
285 farExp_74
286 ( let _ = "resume.genCode"
287 in \x_77 -> v_71 GHC.Types.: v_75 x_77
288 )
289 inp_76
290 )
291 inp_72
292 Data.Map.Internal.Tip
293 )
294 inp_58
295 Data.Map.Internal.Tip
296 in name_24
297 ( let _ = "suspend"
298 in \farInp_78 farExp_79 v_80 (!inp_81) ->
299 name_56
300 ( let _ = "suspend"
301 in \farInp_82 farExp_83 v_84 (!inp_85) ->
302 let join_86 = \farInp_87 farExp_88 v_89 (!inp_90) ->
303 let _ = "resume"
304 in finalRet_13
305 farInp_87
306 farExp_88
307 ( let _ = "resume.genCode"
308 in v_80 GHC.Types.: v_84 GHC.Types . []
309 )
310 inp_90
311 in let _ = "catchException lbl=fail"
312 in let catchHandler_91 (!failInp_92) (!farInp_93) (!farExp_94) =
313 let _ = "catchException.ko lbl=fail"
314 in if ( \( Data.Text.Internal.Text
315 _
316 i_95
317 _
318 )
319 ( Data.Text.Internal.Text
320 _
321 j_96
322 _
323 ) -> i_95 GHC.Classes.== j_96
324 )
325 inp_85
326 failInp_92
327 then
328 let _ = "choicesBranch.then"
329 in let (#
330 farInp_97,
331 farExp_98
332 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_93 failInp_92 of
333 GHC.Types.LT ->
334 (#
335 failInp_92,
336 [Symantic.Parser.Grammar.Combinators.ErrorItemEnd]
337 #)
338 GHC.Types.EQ ->
339 (#
340 farInp_93,
341 farExp_94 GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemEnd]
342 #)
343 GHC.Types.GT ->
344 (#
345 farInp_93,
346 farExp_94
347 #)
348 in finalRaise_18 failInp_92 farInp_97 farExp_98
349 else
350 let _ = "choicesBranch.else"
351 in let (#
352 farInp_99,
353 farExp_100
354 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_93 failInp_92 of
355 GHC.Types.LT ->
356 (#
357 failInp_92,
358 []
359 #)
360 GHC.Types.EQ ->
361 (#
362 farInp_93,
363 farExp_94 GHC.Base.<> []
364 #)
365 GHC.Types.GT ->
366 (#
367 farInp_93,
368 farExp_94
369 #)
370 in finalRaise_18 failInp_92 farInp_99 farExp_100
371 in let _ = "catchException lbl=fail"
372 in let catchHandler_101 (!failInp_102) (!farInp_103) (!farExp_104) =
373 let _ = "catchException.ko lbl=fail"
374 in let _ = "resume"
375 in join_86
376 farInp_103
377 farExp_104
378 ( let _ = "resume.genCode"
379 in GHC.Tuple . ()
380 )
381 inp_85
382 in let readFail_105 = catchHandler_101
383 in if readMore_2 inp_85
384 then
385 let !(#
386 c_106,
387 cs_107
388 #) = readNext_3 inp_85
389 in if (\x_108 -> GHC.Types.True) c_106
390 then
391 let (#
392 farInp_109,
393 farExp_110
394 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_82 inp_85 of
395 GHC.Types.LT ->
396 (#
397 inp_85,
398 []
399 #)
400 GHC.Types.EQ ->
401 (#
402 farInp_82,
403 farExp_83 GHC.Base.<> []
404 #)
405 GHC.Types.GT ->
406 (#
407 farInp_82,
408 farExp_83
409 #)
410 in catchHandler_91 inp_85 farInp_109 farExp_110
411 else
412 let _ = "checkToken.else"
413 in let (#
414 farInp_111,
415 farExp_112
416 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_82 inp_85 of
417 GHC.Types.LT ->
418 (#
419 inp_85,
420 []
421 #)
422 GHC.Types.EQ ->
423 (#
424 farInp_82,
425 farExp_83 GHC.Base.<> []
426 #)
427 GHC.Types.GT ->
428 (#
429 farInp_82,
430 farExp_83
431 #)
432 in readFail_105 inp_85 farInp_111 farExp_112
433 else
434 let _ = "checkHorizon.else"
435 in let (#
436 farInp_113,
437 farExp_114
438 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_82 inp_85 of
439 GHC.Types.LT ->
440 (#
441 inp_85,
442 [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 1]
443 #)
444 GHC.Types.EQ ->
445 (#
446 farInp_82,
447 farExp_83 GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 1]
448 #)
449 GHC.Types.GT ->
450 (#
451 farInp_82,
452 farExp_83
453 #)
454 in readFail_105 inp_85 farInp_113 farExp_114
455 )
456 inp_81
457 Data.Map.Internal.Tip
458 )
459 init_1
460 Data.Map.Internal.Tip