]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G13.expected.txt
change ShowLetName into HideableName
[haskell/symantic-parser.git] / test / Golden / Splice / G13.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.Catcher
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 = farExp
54 }
55 in GHC.ST.runST
56 ( let inputToken = Data.Proxy.Proxy :: Data.Proxy.Proxy (Symantic.Parser.Machine.Input.InputToken inp)
57 in let name = \(!callReturn) (!callInput) (!callCatchStackByLabel) -> do
58 let dupv = \x -> x
59 reg <- GHC.STRef.newSTRef dupv
60 let _ = "iter"
61 in let catchHandler loopInput (!_exn) (!failInp) (!farInp) (!farExp) =
62 if ( \( Data.Text.Internal.Text
63 _
64 i
65 _
66 )
67 ( Data.Text.Internal.Text
68 _
69 j
70 _
71 ) -> i GHC.Classes.== j
72 )
73 loopInput
74 failInp
75 then
76 let _ = "choicesBranch.then"
77 in do
78 sr <- GHC.STRef.readSTRef reg
79 let _ = "resume"
80 in callReturn
81 farInp
82 farExp
83 ( let _ = "resume.genCode"
84 in GHC.Tuple . ()
85 )
86 failInp
87 else
88 let _ = "choicesBranch.else"
89 in Data.Map.Strict.Internal.findWithDefault finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure callCatchStackByLabel Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp
90 loop = \_callReturn callInput callCatchStackByLabel ->
91 let readFail = catchHandler callInput
92 in if readMore callInput
93 then
94 let !(#
95 c,
96 cs
97 #) = readNext callInput
98 in if (\c -> GHC.Classes.not (('<' GHC.Classes.== c) GHC.Classes.|| (('>' GHC.Classes.== c) GHC.Classes.|| (('+' GHC.Classes.== c) GHC.Classes.|| (('-' GHC.Classes.== c) GHC.Classes.|| ((',' GHC.Classes.== c) GHC.Classes.|| (('.' GHC.Classes.== c) GHC.Classes.|| (('[' GHC.Classes.== c) GHC.Classes.|| ((']' GHC.Classes.== c) GHC.Classes.|| GHC.Types.False))))))))) c
99 then do
100 sr <- GHC.STRef.readSTRef reg
101 do
102 let dupv = sr
103 GHC.STRef.writeSTRef reg dupv
104 let _ = "jump"
105 in loop (GHC.Err.error "invalid return") cs (Data.Map.Internal.Bin 1 Symantic.Parser.Grammar.Combinators.ExceptionFailure readFail Data.Map.Internal.Tip Data.Map.Internal.Tip)
106 else
107 let _ = "checkToken.else"
108 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure callInput init Data.Set.Internal.empty
109 else
110 let _ = "checkHorizon.else"
111 in let failExp =
112 Data.Set.Internal.Bin
113 1
114 ( Symantic.Parser.Grammar.Combinators.SomeFailure
115 ( case inputToken of
116 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
117 )
118 )
119 Data.Set.Internal.Tip
120 Data.Set.Internal.Tip
121 in let (#
122 farInp,
123 farExp
124 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init callInput of
125 GHC.Types.LT ->
126 (#
127 callInput,
128 failExp
129 #)
130 GHC.Types.EQ ->
131 (#
132 init,
133 failExp GHC.Base.<> Data.Set.Internal.empty
134 #)
135 GHC.Types.GT ->
136 (#
137 init,
138 Data.Set.Internal.empty
139 #)
140 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure callInput farInp farExp
141 in let _ = "jump"
142 in loop callReturn callInput (Data.Map.Internal.Bin 1 Symantic.Parser.Grammar.Combinators.ExceptionFailure (Data.Map.Strict.Internal.findWithDefault finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure callCatchStackByLabel) Data.Map.Internal.Tip Data.Map.Internal.Tip)
143 name = \(!callReturn) (!callInput) (!callCatchStackByLabel) -> do
144 let dupv = \x -> x
145 reg <- GHC.STRef.newSTRef dupv
146 let _ = "iter"
147 in let catchHandler loopInput (!_exn) (!failInp) (!farInp) (!farExp) =
148 if ( \( Data.Text.Internal.Text
149 _
150 i
151 _
152 )
153 ( Data.Text.Internal.Text
154 _
155 j
156 _
157 ) -> i GHC.Classes.== j
158 )
159 loopInput
160 failInp
161 then
162 let _ = "choicesBranch.then"
163 in do
164 sr <- GHC.STRef.readSTRef reg
165 let _ = "resume"
166 in callReturn
167 farInp
168 farExp
169 ( let _ = "resume.genCode"
170 in sr GHC.Types . []
171 )
172 failInp
173 else
174 let _ = "choicesBranch.else"
175 in Data.Map.Strict.Internal.findWithDefault finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure callCatchStackByLabel Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp
176 loop = \_callReturn callInput callCatchStackByLabel ->
177 let join = \farInp farExp v (!inp) ->
178 name
179 ( let _ = "suspend"
180 in \farInp farExp v (!inp) -> do
181 sr <- GHC.STRef.readSTRef reg
182 do
183 let dupv = \x -> sr ((GHC.Types.:) v x)
184 GHC.STRef.writeSTRef reg dupv
185 let _ = "jump"
186 in loop (GHC.Err.error "invalid return") inp (Data.Map.Internal.Bin 1 Symantic.Parser.Grammar.Combinators.ExceptionFailure (catchHandler callInput) Data.Map.Internal.Tip Data.Map.Internal.Tip)
187 )
188 inp
189 (Data.Map.Internal.Bin 1 Symantic.Parser.Grammar.Combinators.ExceptionFailure (catchHandler callInput) Data.Map.Internal.Tip Data.Map.Internal.Tip)
190 in let readFail = catchHandler callInput
191 in if readMore callInput
192 then
193 let !(#
194 c,
195 cs
196 #) = readNext callInput
197 in if (\x -> (\x -> \x -> (GHC.Classes.==) x x) '<' x) c
198 then
199 let _ = "choicesBranch.then"
200 in let readFail = readFail
201 in if readMore callInput
202 then
203 let !(#
204 c,
205 cs
206 #) = readNext callInput
207 in let _ = "resume"
208 in join
209 init
210 Data.Set.Internal.empty
211 ( let _ = "resume.genCode"
212 in Parsers.Brainfuck.Types.Backward
213 )
214 cs
215 else
216 let _ = "checkHorizon.else"
217 in let failExp =
218 Data.Set.Internal.Bin
219 1
220 ( Symantic.Parser.Grammar.Combinators.SomeFailure
221 ( case inputToken of
222 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
223 )
224 )
225 Data.Set.Internal.Tip
226 Data.Set.Internal.Tip
227 in let (#
228 farInp,
229 farExp
230 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init callInput of
231 GHC.Types.LT ->
232 (#
233 callInput,
234 failExp
235 #)
236 GHC.Types.EQ ->
237 (#
238 init,
239 failExp GHC.Base.<> Data.Set.Internal.empty
240 #)
241 GHC.Types.GT ->
242 (#
243 init,
244 Data.Set.Internal.empty
245 #)
246 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure callInput farInp farExp
247 else
248 let _ = "choicesBranch.else"
249 in if (\x -> (\x -> \x -> (GHC.Classes.==) x x) '>' x) c
250 then
251 let _ = "choicesBranch.then"
252 in let readFail = readFail
253 in if readMore callInput
254 then
255 let !(#
256 c,
257 cs
258 #) = readNext callInput
259 in let _ = "resume"
260 in join
261 init
262 Data.Set.Internal.empty
263 ( let _ = "resume.genCode"
264 in Parsers.Brainfuck.Types.Forward
265 )
266 cs
267 else
268 let _ = "checkHorizon.else"
269 in let failExp =
270 Data.Set.Internal.Bin
271 1
272 ( Symantic.Parser.Grammar.Combinators.SomeFailure
273 ( case inputToken of
274 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
275 )
276 )
277 Data.Set.Internal.Tip
278 Data.Set.Internal.Tip
279 in let (#
280 farInp,
281 farExp
282 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init callInput of
283 GHC.Types.LT ->
284 (#
285 callInput,
286 failExp
287 #)
288 GHC.Types.EQ ->
289 (#
290 init,
291 failExp GHC.Base.<> Data.Set.Internal.empty
292 #)
293 GHC.Types.GT ->
294 (#
295 init,
296 Data.Set.Internal.empty
297 #)
298 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure callInput farInp farExp
299 else
300 let _ = "choicesBranch.else"
301 in if (\x -> (\x -> \x -> (GHC.Classes.==) x x) '+' x) c
302 then
303 let _ = "choicesBranch.then"
304 in let readFail = readFail
305 in if readMore callInput
306 then
307 let !(#
308 c,
309 cs
310 #) = readNext callInput
311 in let _ = "resume"
312 in join
313 init
314 Data.Set.Internal.empty
315 ( let _ = "resume.genCode"
316 in Parsers.Brainfuck.Types.Increment
317 )
318 cs
319 else
320 let _ = "checkHorizon.else"
321 in let failExp =
322 Data.Set.Internal.Bin
323 1
324 ( Symantic.Parser.Grammar.Combinators.SomeFailure
325 ( case inputToken of
326 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
327 )
328 )
329 Data.Set.Internal.Tip
330 Data.Set.Internal.Tip
331 in let (#
332 farInp,
333 farExp
334 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init callInput of
335 GHC.Types.LT ->
336 (#
337 callInput,
338 failExp
339 #)
340 GHC.Types.EQ ->
341 (#
342 init,
343 failExp GHC.Base.<> Data.Set.Internal.empty
344 #)
345 GHC.Types.GT ->
346 (#
347 init,
348 Data.Set.Internal.empty
349 #)
350 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure callInput farInp farExp
351 else
352 let _ = "choicesBranch.else"
353 in if (\x -> (\x -> \x -> (GHC.Classes.==) x x) '-' x) c
354 then
355 let _ = "choicesBranch.then"
356 in let readFail = readFail
357 in if readMore callInput
358 then
359 let !(#
360 c,
361 cs
362 #) = readNext callInput
363 in let _ = "resume"
364 in join
365 init
366 Data.Set.Internal.empty
367 ( let _ = "resume.genCode"
368 in Parsers.Brainfuck.Types.Decrement
369 )
370 cs
371 else
372 let _ = "checkHorizon.else"
373 in let failExp =
374 Data.Set.Internal.Bin
375 1
376 ( Symantic.Parser.Grammar.Combinators.SomeFailure
377 ( case inputToken of
378 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
379 )
380 )
381 Data.Set.Internal.Tip
382 Data.Set.Internal.Tip
383 in let (#
384 farInp,
385 farExp
386 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init callInput of
387 GHC.Types.LT ->
388 (#
389 callInput,
390 failExp
391 #)
392 GHC.Types.EQ ->
393 (#
394 init,
395 failExp GHC.Base.<> Data.Set.Internal.empty
396 #)
397 GHC.Types.GT ->
398 (#
399 init,
400 Data.Set.Internal.empty
401 #)
402 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure callInput farInp farExp
403 else
404 let _ = "choicesBranch.else"
405 in if (\x -> (\x -> \x -> (GHC.Classes.==) x x) ',' x) c
406 then
407 let _ = "choicesBranch.then"
408 in let readFail = readFail
409 in if readMore callInput
410 then
411 let !(#
412 c,
413 cs
414 #) = readNext callInput
415 in let _ = "resume"
416 in join
417 init
418 Data.Set.Internal.empty
419 ( let _ = "resume.genCode"
420 in Parsers.Brainfuck.Types.Input
421 )
422 cs
423 else
424 let _ = "checkHorizon.else"
425 in let failExp =
426 Data.Set.Internal.Bin
427 1
428 ( Symantic.Parser.Grammar.Combinators.SomeFailure
429 ( case inputToken of
430 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
431 )
432 )
433 Data.Set.Internal.Tip
434 Data.Set.Internal.Tip
435 in let (#
436 farInp,
437 farExp
438 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init callInput of
439 GHC.Types.LT ->
440 (#
441 callInput,
442 failExp
443 #)
444 GHC.Types.EQ ->
445 (#
446 init,
447 failExp GHC.Base.<> Data.Set.Internal.empty
448 #)
449 GHC.Types.GT ->
450 (#
451 init,
452 Data.Set.Internal.empty
453 #)
454 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure callInput farInp farExp
455 else
456 let _ = "choicesBranch.else"
457 in if (\x -> (\x -> \x -> (GHC.Classes.==) x x) '.' x) c
458 then
459 let _ = "choicesBranch.then"
460 in let readFail = readFail
461 in if readMore callInput
462 then
463 let !(#
464 c,
465 cs
466 #) = readNext callInput
467 in let _ = "resume"
468 in join
469 init
470 Data.Set.Internal.empty
471 ( let _ = "resume.genCode"
472 in Parsers.Brainfuck.Types.Output
473 )
474 cs
475 else
476 let _ = "checkHorizon.else"
477 in let failExp =
478 Data.Set.Internal.Bin
479 1
480 ( Symantic.Parser.Grammar.Combinators.SomeFailure
481 ( case inputToken of
482 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
483 )
484 )
485 Data.Set.Internal.Tip
486 Data.Set.Internal.Tip
487 in let (#
488 farInp,
489 farExp
490 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init callInput of
491 GHC.Types.LT ->
492 (#
493 callInput,
494 failExp
495 #)
496 GHC.Types.EQ ->
497 (#
498 init,
499 failExp GHC.Base.<> Data.Set.Internal.empty
500 #)
501 GHC.Types.GT ->
502 (#
503 init,
504 Data.Set.Internal.empty
505 #)
506 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure callInput farInp farExp
507 else
508 let _ = "choicesBranch.else"
509 in if (\x -> (\x -> \x -> (GHC.Classes.==) x x) '[' x) c
510 then
511 let _ = "choicesBranch.then"
512 in let readFail = readFail
513 in if readMore callInput
514 then
515 let !(#
516 c,
517 cs
518 #) = readNext callInput
519 in name
520 ( let _ = "suspend"
521 in \farInp farExp v (!inp) ->
522 name
523 ( let _ = "suspend"
524 in \farInp farExp v (!inp) ->
525 let readFail = readFail
526 in if readMore inp
527 then
528 let !(#
529 c,
530 cs
531 #) = readNext inp
532 in if (GHC.Classes.==) ']' c
533 then
534 let _ = "resume"
535 in join
536 farInp
537 farExp
538 ( let _ = "resume.genCode"
539 in Parsers.Brainfuck.Types.Loop v
540 )
541 cs
542 else
543 let _ = "checkToken.else"
544 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure inp farInp farExp
545 else
546 let _ = "checkHorizon.else"
547 in let failExp =
548 Data.Set.Internal.Bin
549 1
550 ( Symantic.Parser.Grammar.Combinators.SomeFailure
551 ( case inputToken of
552 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
553 )
554 )
555 Data.Set.Internal.Tip
556 Data.Set.Internal.Tip
557 in let (#
558 farInp,
559 farExp
560 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp inp of
561 GHC.Types.LT ->
562 (#
563 inp,
564 failExp
565 #)
566 GHC.Types.EQ ->
567 (#
568 farInp,
569 failExp GHC.Base.<> farExp
570 #)
571 GHC.Types.GT ->
572 (#
573 farInp,
574 farExp
575 #)
576 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure inp farInp farExp
577 )
578 inp
579 (Data.Map.Internal.Bin 1 Symantic.Parser.Grammar.Combinators.ExceptionFailure readFail Data.Map.Internal.Tip Data.Map.Internal.Tip)
580 )
581 cs
582 (Data.Map.Internal.Bin 1 Symantic.Parser.Grammar.Combinators.ExceptionFailure readFail Data.Map.Internal.Tip Data.Map.Internal.Tip)
583 else
584 let _ = "checkHorizon.else"
585 in let failExp =
586 Data.Set.Internal.Bin
587 1
588 ( Symantic.Parser.Grammar.Combinators.SomeFailure
589 ( case inputToken of
590 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
591 )
592 )
593 Data.Set.Internal.Tip
594 Data.Set.Internal.Tip
595 in let (#
596 farInp,
597 farExp
598 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init callInput of
599 GHC.Types.LT ->
600 (#
601 callInput,
602 failExp
603 #)
604 GHC.Types.EQ ->
605 (#
606 init,
607 failExp GHC.Base.<> Data.Set.Internal.empty
608 #)
609 GHC.Types.GT ->
610 (#
611 init,
612 Data.Set.Internal.empty
613 #)
614 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure callInput farInp farExp
615 else
616 let _ = "choicesBranch.else"
617 in let failExp = Data.Set.Internal.Bin 1 (Symantic.Parser.Grammar.Combinators.SomeFailure Symantic.Parser.Grammar.Combinators.FailureEmpty) Data.Set.Internal.Tip Data.Set.Internal.Tip
618 in let (#
619 farInp,
620 farExp
621 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init callInput of
622 GHC.Types.LT ->
623 (#
624 callInput,
625 failExp
626 #)
627 GHC.Types.EQ ->
628 (#
629 init,
630 failExp GHC.Base.<> Data.Set.Internal.empty
631 #)
632 GHC.Types.GT ->
633 (#
634 init,
635 Data.Set.Internal.empty
636 #)
637 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure callInput farInp farExp
638 else
639 let _ = "checkHorizon.else"
640 in let failExp =
641 Data.Set.Internal.Bin
642 1
643 ( Symantic.Parser.Grammar.Combinators.SomeFailure
644 ( case inputToken of
645 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
646 )
647 )
648 Data.Set.Internal.Tip
649 Data.Set.Internal.Tip
650 in let (#
651 farInp,
652 farExp
653 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init callInput of
654 GHC.Types.LT ->
655 (#
656 callInput,
657 failExp
658 #)
659 GHC.Types.EQ ->
660 (#
661 init,
662 failExp GHC.Base.<> Data.Set.Internal.empty
663 #)
664 GHC.Types.GT ->
665 (#
666 init,
667 Data.Set.Internal.empty
668 #)
669 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure callInput farInp farExp
670 in let _ = "jump"
671 in loop callReturn callInput (Data.Map.Internal.Bin 1 Symantic.Parser.Grammar.Combinators.ExceptionFailure (Data.Map.Strict.Internal.findWithDefault finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure callCatchStackByLabel) Data.Map.Internal.Tip Data.Map.Internal.Tip)
672 in name
673 ( let _ = "suspend"
674 in \farInp farExp v (!inp) ->
675 name
676 ( let _ = "suspend"
677 in \farInp farExp v (!inp) ->
678 let _ = "resume"
679 in finalRet
680 farInp
681 farExp
682 ( let _ = "resume.genCode"
683 in GHC.Show.show v
684 )
685 inp
686 )
687 inp
688 Data.Map.Internal.Tip
689 )
690 init
691 Data.Map.Internal.Tip
692 )