]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G5.expected.txt
test: dump splices using TH.runQ instead of calling ghc
[haskell/symantic-parser.git] / test / Golden / Splice / G5.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 in let finalRet = \_farInp _farExp v _inp -> Data.Either.Right v
31 in let finalRaise ::
32 forall b.
33 Symantic.Parser.Machine.Generate.Catcher
34 inp
35 b = \_failInp (!farInp) (!farExp) ->
36 Data.Either.Left
37 Symantic.Parser.Machine.Generate.ParsingErrorStandard
38 { Symantic.Parser.Machine.Generate.parsingErrorOffset = Symantic.Parser.Machine.Input.offset farInp,
39 Symantic.Parser.Machine.Generate.parsingErrorUnexpected =
40 if readMore farInp
41 then
42 GHC.Maybe.Just
43 ( let (#
44 c,
45 _
46 #) = readNext farInp
47 in c
48 )
49 else GHC.Maybe.Nothing,
50 Symantic.Parser.Machine.Generate.parsingErrorExpecting = Data.Set.Internal.fromList farExp
51 }
52 in let name = \(!ok) (!inp) (!koByLabel) ->
53 let _ = "catchException lbl=fail"
54 in let catchHandler (!failInp) (!farInp) (!farExp) =
55 let _ = "catchException.ko lbl=fail"
56 in if ( \( Data.Text.Internal.Text
57 _
58 i
59 _
60 )
61 ( Data.Text.Internal.Text
62 _
63 j
64 _
65 ) -> i GHC.Classes.== j
66 )
67 inp
68 failInp
69 then
70 let _ = "choicesBranch.then"
71 in let _ = "resume"
72 in ok
73 farInp
74 farExp
75 ( let _ = "resume.genCode"
76 in \x -> x
77 )
78 failInp
79 else
80 let _ = "choicesBranch.else"
81 in let (#
82 farInp,
83 farExp
84 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
85 GHC.Types.LT ->
86 (#
87 failInp,
88 []
89 #)
90 GHC.Types.EQ ->
91 (#
92 farInp,
93 farExp GHC.Base.<> []
94 #)
95 GHC.Types.GT ->
96 (#
97 farInp,
98 farExp
99 #)
100 in finalRaise failInp farInp farExp
101 in name
102 ( let _ = "suspend"
103 in \farInp farExp v (!inp) ->
104 name
105 ( let _ = "suspend"
106 in \farInp farExp v (!inp) ->
107 let _ = "resume"
108 in ok
109 farInp
110 farExp
111 ( let _ = "resume.genCode"
112 in \x -> v GHC.Types.: v x
113 )
114 inp
115 )
116 inp
117 Data.Map.Internal.Tip
118 )
119 inp
120 Data.Map.Internal.Tip
121 name = \(!ok) (!inp) (!koByLabel) ->
122 let _ = "catchException lbl=fail"
123 in let catchHandler (!failInp) (!farInp) (!farExp) =
124 let _ = "catchException.ko lbl=fail"
125 in let (#
126 farInp,
127 farExp
128 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp inp of
129 GHC.Types.LT ->
130 (#
131 inp,
132 []
133 #)
134 GHC.Types.EQ ->
135 (#
136 farInp,
137 farExp GHC.Base.<> []
138 #)
139 GHC.Types.GT ->
140 (#
141 farInp,
142 farExp
143 #)
144 in finalRaise inp farInp farExp
145 in let readFail = catchHandler
146 in if readMore (Symantic.Parser.Machine.Input.shiftRightText 3 inp)
147 then
148 let !(#
149 c,
150 cs
151 #) = readNext inp
152 in if ('a' GHC.Classes.==) c
153 then
154 let readFail = readFail
155 in let !(#
156 c,
157 cs
158 #) = readNext cs
159 in if ('b' GHC.Classes.==) c
160 then
161 let readFail = readFail
162 in let !(#
163 c,
164 cs
165 #) = readNext cs
166 in if ('c' GHC.Classes.==) c
167 then
168 let readFail = readFail
169 in let !(#
170 c,
171 cs
172 #) = readNext cs
173 in if ('d' GHC.Classes.==) c
174 then
175 let _ = "resume"
176 in ok init GHC.Types
177 . []
178 ( let _ = "resume.genCode"
179 in 'a' GHC.Types.: ('b' GHC.Types.: ('c' GHC.Types.: ('d' GHC.Types.: GHC.Types . [])))
180 )
181 cs
182 else
183 let _ = "checkToken.else"
184 in let (#
185 farInp,
186 farExp
187 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init cs of
188 GHC.Types.LT ->
189 (#
190 cs,
191 [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'd']
192 #)
193 GHC.Types.EQ ->
194 (#
195 init,
196 GHC.Types . [] GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'd']
197 #)
198 GHC.Types.GT ->
199 (#
200 init,
201 GHC.Types . []
202 #)
203 in readFail cs farInp farExp
204 else
205 let _ = "checkToken.else"
206 in let (#
207 farInp,
208 farExp
209 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init cs of
210 GHC.Types.LT ->
211 (#
212 cs,
213 [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'c']
214 #)
215 GHC.Types.EQ ->
216 (#
217 init,
218 GHC.Types . [] GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'c']
219 #)
220 GHC.Types.GT ->
221 (#
222 init,
223 GHC.Types . []
224 #)
225 in readFail cs farInp farExp
226 else
227 let _ = "checkToken.else"
228 in let (#
229 farInp,
230 farExp
231 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init cs of
232 GHC.Types.LT ->
233 (#
234 cs,
235 [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'b']
236 #)
237 GHC.Types.EQ ->
238 (#
239 init,
240 GHC.Types . [] GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'b']
241 #)
242 GHC.Types.GT ->
243 (#
244 init,
245 GHC.Types . []
246 #)
247 in readFail cs farInp farExp
248 else
249 let _ = "checkToken.else"
250 in let (#
251 farInp,
252 farExp
253 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init inp of
254 GHC.Types.LT ->
255 (#
256 inp,
257 [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'a']
258 #)
259 GHC.Types.EQ ->
260 (#
261 init,
262 GHC.Types . [] GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'a']
263 #)
264 GHC.Types.GT ->
265 (#
266 init,
267 GHC.Types . []
268 #)
269 in readFail inp farInp farExp
270 else
271 let _ = "checkHorizon.else"
272 in let (#
273 farInp,
274 farExp
275 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init inp of
276 GHC.Types.LT ->
277 (#
278 inp,
279 [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 4]
280 #)
281 GHC.Types.EQ ->
282 (#
283 init,
284 GHC.Types . [] GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 4]
285 #)
286 GHC.Types.GT ->
287 (#
288 init,
289 GHC.Types . []
290 #)
291 in readFail inp farInp farExp
292 in name
293 ( let _ = "suspend"
294 in \farInp farExp v (!inp) ->
295 name
296 ( let _ = "suspend"
297 in \farInp farExp v (!inp) ->
298 let join = \farInp farExp v (!inp) ->
299 let _ = "resume"
300 in finalRet
301 farInp
302 farExp
303 ( let _ = "resume.genCode"
304 in GHC.Show.show (v GHC.Types.: v GHC.Types . [])
305 )
306 inp
307 in let _ = "catchException lbl=fail"
308 in let catchHandler (!failInp) (!farInp) (!farExp) =
309 let _ = "catchException.ko lbl=fail"
310 in if ( \( Data.Text.Internal.Text
311 _
312 i
313 _
314 )
315 ( Data.Text.Internal.Text
316 _
317 j
318 _
319 ) -> i GHC.Classes.== j
320 )
321 inp
322 failInp
323 then
324 let _ = "choicesBranch.then"
325 in let (#
326 farInp,
327 farExp
328 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
329 GHC.Types.LT ->
330 (#
331 failInp,
332 [Symantic.Parser.Grammar.Combinators.ErrorItemEnd]
333 #)
334 GHC.Types.EQ ->
335 (#
336 farInp,
337 farExp GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemEnd]
338 #)
339 GHC.Types.GT ->
340 (#
341 farInp,
342 farExp
343 #)
344 in finalRaise failInp farInp farExp
345 else
346 let _ = "choicesBranch.else"
347 in let (#
348 farInp,
349 farExp
350 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
351 GHC.Types.LT ->
352 (#
353 failInp,
354 []
355 #)
356 GHC.Types.EQ ->
357 (#
358 farInp,
359 farExp GHC.Base.<> []
360 #)
361 GHC.Types.GT ->
362 (#
363 farInp,
364 farExp
365 #)
366 in finalRaise failInp farInp farExp
367 in let _ = "catchException lbl=fail"
368 in let catchHandler (!failInp) (!farInp) (!farExp) =
369 let _ = "catchException.ko lbl=fail"
370 in let _ = "resume"
371 in join
372 farInp
373 farExp
374 ( let _ = "resume.genCode"
375 in GHC.Tuple . ()
376 )
377 inp
378 in let readFail = catchHandler
379 in if readMore inp
380 then
381 let !(#
382 c,
383 cs
384 #) = readNext inp
385 in if (\x -> GHC.Types.True) c
386 then
387 let (#
388 farInp,
389 farExp
390 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp inp of
391 GHC.Types.LT ->
392 (#
393 inp,
394 []
395 #)
396 GHC.Types.EQ ->
397 (#
398 farInp,
399 farExp GHC.Base.<> []
400 #)
401 GHC.Types.GT ->
402 (#
403 farInp,
404 farExp
405 #)
406 in catchHandler inp farInp farExp
407 else
408 let _ = "checkToken.else"
409 in let (#
410 farInp,
411 farExp
412 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp inp of
413 GHC.Types.LT ->
414 (#
415 inp,
416 []
417 #)
418 GHC.Types.EQ ->
419 (#
420 farInp,
421 farExp GHC.Base.<> []
422 #)
423 GHC.Types.GT ->
424 (#
425 farInp,
426 farExp
427 #)
428 in readFail inp farInp farExp
429 else
430 let _ = "checkHorizon.else"
431 in let (#
432 farInp,
433 farExp
434 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp inp of
435 GHC.Types.LT ->
436 (#
437 inp,
438 [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 1]
439 #)
440 GHC.Types.EQ ->
441 (#
442 farInp,
443 farExp GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 1]
444 #)
445 GHC.Types.GT ->
446 (#
447 farInp,
448 farExp
449 #)
450 in readFail inp farInp farExp
451 )
452 inp
453 Data.Map.Internal.Tip
454 )
455 init
456 Data.Map.Internal.Tip