10 let !( Data.Text.Unsafe.Iter
13 ) = Symantic.Parser.Machine.Input.Text.Buffer.iter buf pos
14 in (# c, pos GHC.Num.+ d #)
15 more buf pos = pos GHC.Classes.< Symantic.Parser.Machine.Input.Text.Buffer.length buf
16 append = Symantic.Parser.Machine.Input.Text.Buffer.pappend
18 Symantic.Parser.Machine.Input.Text.Buffer.buffer input,
24 finalRet = \_farInp _farExp v _inp _buf _end -> Symantic.Parser.Machine.Generate.returnST GHC.Base.$ Symantic.Parser.Machine.Generate.ResultDone v
25 finalRaise :: Symantic.Parser.Machine.Generate.ForallOnException inp =
26 Symantic.Parser.Machine.Generate.ForallOnException GHC.Base.$
27 ( \(!exn) _failInp (!farInp) (!farExp) buf end ->
28 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
29 Symantic.Parser.Machine.Generate.ResultError
30 Symantic.Parser.Machine.Generate.ParsingError
31 { Symantic.Parser.Machine.Generate.parsingErrorOffset = Symantic.Parser.Machine.Input.position farInp,
32 Symantic.Parser.Machine.Generate.parsingErrorException = exn,
33 Symantic.Parser.Machine.Generate.parsingErrorUnexpected =
34 if readMore buf farInp
40 #) = readNext buf farInp
43 else GHC.Maybe.Nothing,
44 Symantic.Parser.Machine.Generate.parsingErrorExpecting =
48 Data.Set.Internal.foldr
52 ) -> case Symantic.Parser.Grammar.Combinators.unSomeFailure f of
53 GHC.Maybe.Just (Symantic.Parser.Grammar.Combinators.FailureHorizon h :: Symantic.Parser.Grammar.Combinators.Failure (Symantic.Parser.Grammar.Combinators.CombSatisfiable (Symantic.Parser.Machine.Input.InputToken inp)))
54 | GHC.Maybe.Just old <- minH ->
55 ( GHC.Maybe.Just (GHC.Classes.min old h),
58 | GHC.Base.otherwise ->
71 in Data.Set.Internal.fromList GHC.Base.$
73 GHC.Maybe.Just h -> Symantic.Parser.Grammar.Combinators.SomeFailure (Symantic.Parser.Grammar.Combinators.FailureHorizon @(Symantic.Parser.Machine.Input.InputToken inp) h) GHC.Types.: res
74 GHC.Maybe.Nothing -> res
78 in let inputToken = Data.Proxy.Proxy :: Data.Proxy.Proxy (Symantic.Parser.Machine.Input.InputToken inp)
79 in let partialCont buf =
80 let readFail = Symantic.Parser.Machine.Generate.unForallOnException finalRaise
81 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=2"
82 in if readMore buf ((GHC.Num.+) @GHC.Types.Int 1 initPos)
85 in let _ = "pushValue"
86 in let join = \farInp farExp v (!inp) buf end ->
87 let _ = "lift2Value checkedHorizon=0"
92 ( let _ = "resume.genCode"
98 in let _ = "catch ExceptionFailure checkedHorizon=2"
100 let _ = "onException"
101 in \(!_exn) (!failInp) (!farInp) (!farExp) buf end ->
102 let _ = "comment: raiseAgainIfConsumed"
103 in let _ = "saveInput checkedHorizon=0"
104 in let _ = "lift2Value checkedHorizon=0"
105 in if (GHC.Classes.==) @GHC.Types.Int initPos failInp
107 let _ = "choicesBranch checkedHorizon=0"
108 in let _ = "catch ExceptionFailure checkedHorizon=0"
110 let _ = "onException"
111 in \(!_exn) (!failInp) (!farInp) (!farExp) buf end ->
112 let _ = "comment: raiseAgainIfConsumed"
113 in let _ = "saveInput checkedHorizon=0"
114 in let _ = "lift2Value checkedHorizon=0"
115 in if (GHC.Classes.==) @GHC.Types.Int failInp failInp
117 let _ = "choicesBranch checkedHorizon=0"
118 in let _ = "catch ExceptionFailure checkedHorizon=0"
120 let _ = "onException"
121 in \(!_exn) (!failInp) (!farInp) (!farExp) buf end ->
122 let _ = "loadInput checkedHorizon=0"
123 in let _ = "checkHorizon.noCheck"
124 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
125 in let _ = "pushValue"
126 in let _ = "comment: satisfy ((GHC.Classes.==) 'f')"
127 in let partialCont buf =
128 let readFail = onException
129 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=4"
130 in if readMore buf ((GHC.Num.+) @GHC.Types.Int 3 failInp)
136 #) = readNext buf failInp
137 in if (GHC.Classes.==) 'f' c
139 let _ = "lift2Value checkedHorizon=4"
140 in let _ = "comment: satisfy ((GHC.Classes.==) 'g')"
141 in let _ = "checkHorizon.oldCheck: checkedHorizon=4"
142 in let _ = "checkToken"
147 in if (GHC.Classes.==) 'g' c
149 let _ = "lift2Value checkedHorizon=3"
150 in let _ = "comment: satisfy ((GHC.Classes.==) 'h')"
151 in let _ = "checkHorizon.oldCheck: checkedHorizon=3"
152 in let _ = "checkToken"
157 in if (GHC.Classes.==) 'h' c
159 let _ = "lift2Value checkedHorizon=2"
160 in let _ = "comment: satisfy ((GHC.Classes.==) 'i')"
161 in let _ = "checkHorizon.oldCheck: checkedHorizon=2"
162 in let _ = "checkToken"
167 in if (GHC.Classes.==) 'i' c
169 let _ = "lift2Value checkedHorizon=1"
175 ( let _ = "resume.genCode"
176 in (GHC.Types.:) 'f' ((GHC.Types.:) 'g' ((GHC.Types.:) 'h' ((GHC.Types.:) 'i' GHC.Types . [])))
182 let _ = "checkToken.fail"
184 Data.Set.Internal.Bin
186 ( Symantic.Parser.Grammar.Combinators.SomeFailure
188 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'i'
191 Data.Set.Internal.Tip
192 Data.Set.Internal.Tip
196 #) = case GHC.Classes.compare @GHC.Types.Int farInp cs of
205 failExp GHC.Base.<> farExp
212 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure cs farInp farExp buf end
214 let _ = "checkToken.fail"
216 Data.Set.Internal.Bin
218 ( Symantic.Parser.Grammar.Combinators.SomeFailure
220 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'h'
223 Data.Set.Internal.Tip
224 Data.Set.Internal.Tip
228 #) = case GHC.Classes.compare @GHC.Types.Int farInp cs of
237 failExp GHC.Base.<> farExp
244 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure cs farInp farExp buf end
246 let _ = "checkToken.fail"
248 Data.Set.Internal.Bin
250 ( Symantic.Parser.Grammar.Combinators.SomeFailure
252 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'g'
255 Data.Set.Internal.Tip
256 Data.Set.Internal.Tip
260 #) = case GHC.Classes.compare @GHC.Types.Int farInp cs of
269 failExp GHC.Base.<> farExp
276 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure cs farInp farExp buf end
278 let _ = "checkToken.fail"
280 Data.Set.Internal.Bin
282 ( Symantic.Parser.Grammar.Combinators.SomeFailure
284 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'f'
287 Data.Set.Internal.Tip
288 Data.Set.Internal.Tip
292 #) = case GHC.Classes.compare @GHC.Types.Int farInp failInp of
301 failExp GHC.Base.<> farExp
308 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
310 let _ = "checkHorizon.newCheck.fail"
313 Data.Set.Internal.Bin
315 ( Symantic.Parser.Grammar.Combinators.SomeFailure
317 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 4
320 Data.Set.Internal.Tip
321 Data.Set.Internal.Tip
325 #) = case GHC.Classes.compare @GHC.Types.Int farInp failInp of
334 failExp GHC.Base.<> farExp
341 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf GHC.Types.True
345 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
346 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
348 if Symantic.Parser.Machine.Input.nullInput newInput
350 else partialCont (append buf newInput)
355 let _ = "choicesBranch.else"
356 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
357 in let _ = "catch ExceptionFailure checkedHorizon=0"
359 let _ = "onException"
360 in \(!_exn) (!failInp) (!farInp) (!farExp) buf end ->
361 let _ = "loadInput checkedHorizon=0"
362 in let _ = "checkHorizon.noCheck"
363 in onException Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
364 in let _ = "pushValue"
365 in let _ = "comment: satisfy ((GHC.Classes.==) 'd')"
366 in let partialCont buf =
367 let readFail = onException
368 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=2"
369 in if readMore buf ((GHC.Num.+) @GHC.Types.Int 1 failInp)
375 #) = readNext buf failInp
376 in if (GHC.Classes.==) 'd' c
378 let _ = "lift2Value checkedHorizon=2"
379 in let _ = "comment: satisfy ((GHC.Classes.==) 'e')"
380 in let _ = "checkHorizon.oldCheck: checkedHorizon=2"
381 in let _ = "checkToken"
386 in if (GHC.Classes.==) 'e' c
388 let _ = "lift2Value checkedHorizon=1"
395 ( let _ = "resume.genCode"
396 in (GHC.Types.:) 'd' ((GHC.Types.:) 'e' GHC.Types . [])
402 let _ = "checkToken.fail"
404 Data.Set.Internal.Bin
406 ( Symantic.Parser.Grammar.Combinators.SomeFailure
408 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'e'
411 Data.Set.Internal.Tip
412 Data.Set.Internal.Tip
416 #) = case GHC.Classes.compare @GHC.Types.Int farInp cs of
425 failExp GHC.Base.<> farExp
432 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure cs farInp farExp buf end
434 let _ = "checkToken.fail"
436 Data.Set.Internal.Bin
438 ( Symantic.Parser.Grammar.Combinators.SomeFailure
440 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'd'
443 Data.Set.Internal.Tip
444 Data.Set.Internal.Tip
448 #) = case GHC.Classes.compare @GHC.Types.Int farInp failInp of
457 failExp GHC.Base.<> farExp
464 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
466 let _ = "checkHorizon.newCheck.fail"
469 Data.Set.Internal.Bin
471 ( Symantic.Parser.Grammar.Combinators.SomeFailure
473 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 2
476 Data.Set.Internal.Tip
477 Data.Set.Internal.Tip
481 #) = case GHC.Classes.compare @GHC.Types.Int farInp failInp of
490 failExp GHC.Base.<> farExp
497 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf GHC.Types.True
501 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
502 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
504 if Symantic.Parser.Machine.Input.nullInput newInput
506 else partialCont (append buf newInput)
511 let _ = "choicesBranch.else"
512 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
513 in let _ = "catch ExceptionFailure checkedHorizon=2"
515 let _ = "onException"
516 in \(!_exn) (!failInp) (!farInp) (!farExp) buf end ->
517 let _ = "loadInput checkedHorizon=2"
518 in let _ = "checkHorizon.oldCheck: checkedHorizon=2"
519 in onException Symantic.Parser.Grammar.Combinators.ExceptionFailure initPos farInp farExp buf end
520 in let _ = "pushValue"
521 in let _ = "comment: satisfy ((GHC.Classes.==) 'a')"
522 in let _ = "checkHorizon.oldCheck: checkedHorizon=2"
523 in let _ = "checkToken"
527 #) = readNext buf initPos
528 in if (GHC.Classes.==) 'a' c
530 let _ = "lift2Value checkedHorizon=1"
531 in let _ = "comment: satisfy ((GHC.Classes.==) 'b')"
532 in let _ = "checkHorizon.oldCheck: checkedHorizon=1"
533 in let _ = "checkToken"
538 in if (GHC.Classes.==) 'b' c
540 let _ = "lift2Value checkedHorizon=0"
541 in let _ = "comment: satisfy ((GHC.Classes.==) 'c')"
542 in let partialCont buf =
543 let readFail = onException
544 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=1"
545 in if readMore buf cs
552 in if (GHC.Classes.==) 'c' c
554 let _ = "lift2Value checkedHorizon=1"
560 Data.Set.Internal.empty
561 ( let _ = "resume.genCode"
562 in (GHC.Types.:) 'a' ((GHC.Types.:) 'b' ((GHC.Types.:) 'c' GHC.Types . []))
568 let _ = "checkToken.fail"
570 Data.Set.Internal.Bin
572 ( Symantic.Parser.Grammar.Combinators.SomeFailure
574 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'c'
577 Data.Set.Internal.Tip
578 Data.Set.Internal.Tip
582 #) = case GHC.Classes.compare @GHC.Types.Int initPos cs of
591 failExp GHC.Base.<> Data.Set.Internal.empty
596 Data.Set.Internal.empty
598 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure cs farInp farExp buf GHC.Types.False
600 let _ = "checkHorizon.newCheck.fail"
603 Data.Set.Internal.Bin
605 ( Symantic.Parser.Grammar.Combinators.SomeFailure
607 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
610 Data.Set.Internal.Tip
611 Data.Set.Internal.Tip
615 #) = case GHC.Classes.compare @GHC.Types.Int initPos cs of
624 failExp GHC.Base.<> Data.Set.Internal.empty
629 Data.Set.Internal.empty
631 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure cs farInp farExp buf GHC.Types.True
632 in if GHC.Types.False
635 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
636 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
638 if Symantic.Parser.Machine.Input.nullInput newInput
640 else partialCont (append buf newInput)
645 let _ = "checkToken.fail"
647 Data.Set.Internal.Bin
649 ( Symantic.Parser.Grammar.Combinators.SomeFailure
651 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'b'
654 Data.Set.Internal.Tip
655 Data.Set.Internal.Tip
659 #) = case GHC.Classes.compare @GHC.Types.Int initPos cs of
668 failExp GHC.Base.<> Data.Set.Internal.empty
673 Data.Set.Internal.empty
675 in onException Symantic.Parser.Grammar.Combinators.ExceptionFailure cs farInp farExp buf GHC.Types.False
677 let _ = "checkToken.fail"
679 Data.Set.Internal.Bin
681 ( Symantic.Parser.Grammar.Combinators.SomeFailure
683 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
686 Data.Set.Internal.Tip
687 Data.Set.Internal.Tip
691 #) = case GHC.Classes.compare @GHC.Types.Int initPos initPos of
700 failExp GHC.Base.<> Data.Set.Internal.empty
705 Data.Set.Internal.empty
707 in onException Symantic.Parser.Grammar.Combinators.ExceptionFailure initPos farInp farExp buf GHC.Types.False
709 let _ = "checkHorizon.newCheck.fail"
712 Data.Set.Internal.Bin
714 ( Symantic.Parser.Grammar.Combinators.SomeFailure
716 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 2
719 Data.Set.Internal.Tip
720 Data.Set.Internal.Tip
724 #) = case GHC.Classes.compare @GHC.Types.Int initPos initPos of
733 failExp GHC.Base.<> Data.Set.Internal.empty
738 Data.Set.Internal.empty
740 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure initPos farInp farExp buf GHC.Types.True
741 in if GHC.Types.False
744 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
745 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
747 if Symantic.Parser.Machine.Input.nullInput newInput
749 else partialCont (append buf newInput)
752 in partialCont initBuffer