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 _ = "checkHorizon.noCheck"
80 in let name = \(!callerOnReturn) (!callerInput) (!callerBuffer) (!callerEnd) (!callerOnExceptionStackByLabel) ->
82 in let _ = "pushValue"
85 reg <- GHC.STRef.newSTRef dupv
87 in let onException loopInput =
89 in \(!_exn) (!failInp) (!farInp) (!farExp) buf end ->
90 let _ = "comment: raiseAgainIfConsumed"
91 in let _ = "saveInput checkedHorizon=0"
92 in let _ = "lift2Value checkedHorizon=0"
93 in if (GHC.Classes.==) @GHC.Types.Int loopInput failInp
95 let _ = "choicesBranch checkedHorizon=0"
97 sr <- GHC.STRef.readSTRef reg
99 in let _ = "lift2Value checkedHorizon=0"
100 in let _ = "lift2Value checkedHorizon=0"
105 ( let _ = "resume.genCode"
112 let _ = "choicesBranch.else"
113 in Data.Map.Strict.Internal.findWithDefault (Symantic.Parser.Machine.Generate.unForallOnException finalRaise) Symantic.Parser.Grammar.Combinators.ExceptionFailure callerOnExceptionStackByLabel Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
114 loop = \_callerOnReturn callerInput callerBuffer callerEnded callerOnExceptionStackByLabel ->
116 in let _ = "comment: satisfy (\\c_0 -> GHC.Classes.not (('<' GHC.Classes.== c_0) GHC.Classes.|| (('>' GHC.Classes.== c_0) GHC.Classes.|| (('+' GHC.Classes.== c_0) GHC.Classes.|| (('-' GHC.Classes.== c_0) GHC.Classes.|| ((',' GHC.Classes.== c_0) GHC.Classes.|| (('.' GHC.Classes.== c_0) GHC.Classes.|| (('[' GHC.Classes.== c_0) GHC.Classes.|| ((']' GHC.Classes.== c_0) GHC.Classes.|| GHC.Types.False)))))))))"
117 in let partialCont buf =
118 let readFail = onException callerInput
119 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=1"
120 in if readMore buf callerInput
126 #) = readNext buf callerInput
127 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
129 let _ = "lift2Value checkedHorizon=1"
131 sr <- GHC.STRef.readSTRef reg
132 let _ = "lift2Value checkedHorizon=1"
135 GHC.STRef.writeSTRef reg dupv
137 in loop (GHC.Err.error "invalid onReturn") cs buf callerEnded (Data.Map.Internal.Bin 1 Symantic.Parser.Grammar.Combinators.ExceptionFailure readFail Data.Map.Internal.Tip Data.Map.Internal.Tip)
139 let _ = "checkToken.fail"
140 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure callerInput initPos Data.Set.Internal.empty buf callerEnded
142 let _ = "checkHorizon.newCheck.fail"
145 Data.Set.Internal.Bin
147 ( Symantic.Parser.Grammar.Combinators.SomeFailure
149 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
152 Data.Set.Internal.Tip
153 Data.Set.Internal.Tip
157 #) = case GHC.Classes.compare @GHC.Types.Int initPos callerInput of
166 failExp GHC.Base.<> Data.Set.Internal.empty
171 Data.Set.Internal.empty
173 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure callerInput farInp farExp buf GHC.Types.True
177 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
178 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
180 if Symantic.Parser.Machine.Input.nullInput newInput
182 else partialCont (append buf newInput)
185 in partialCont callerBuffer
187 in loop callerOnReturn callerInput callerBuffer callerEnd (Data.Map.Internal.Bin 1 Symantic.Parser.Grammar.Combinators.ExceptionFailure (Data.Map.Strict.Internal.findWithDefault (Symantic.Parser.Machine.Generate.unForallOnException finalRaise) Symantic.Parser.Grammar.Combinators.ExceptionFailure callerOnExceptionStackByLabel) Data.Map.Internal.Tip Data.Map.Internal.Tip)
188 name = \(!callerOnReturn) (!callerInput) (!callerBuffer) (!callerEnd) (!callerOnExceptionStackByLabel) ->
192 reg <- GHC.STRef.newSTRef dupv
194 in let onException loopInput =
195 let _ = "onException"
196 in \(!_exn) (!failInp) (!farInp) (!farExp) buf end ->
197 let _ = "comment: raiseAgainIfConsumed"
198 in let _ = "saveInput checkedHorizon=0"
199 in let _ = "lift2Value checkedHorizon=0"
200 in if (GHC.Classes.==) @GHC.Types.Int loopInput failInp
202 let _ = "choicesBranch checkedHorizon=0"
204 sr <- GHC.STRef.readSTRef reg
206 in let _ = "lift2Value checkedHorizon=0"
211 ( let _ = "resume.genCode"
218 let _ = "choicesBranch.else"
219 in Data.Map.Strict.Internal.findWithDefault (Symantic.Parser.Machine.Generate.unForallOnException finalRaise) Symantic.Parser.Grammar.Combinators.ExceptionFailure callerOnExceptionStackByLabel Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
220 loop = \_callerOnReturn callerInput callerBuffer callerEnded callerOnExceptionStackByLabel ->
222 in let join = \farInp farExp v (!inp) buf end ->
223 let _ = "lift2Value checkedHorizon=0"
226 in \farInp farExp v (!inp) buf end ->
227 let _ = "lift2Value checkedHorizon=0"
228 in let _ = "pushValue"
229 in let _ = "lift2Value checkedHorizon=0"
231 sr <- GHC.STRef.readSTRef reg
232 let _ = "lift2Value checkedHorizon=0"
234 let dupv = \u -> sr ((GHC.Types.:) v u)
235 GHC.STRef.writeSTRef reg dupv
237 in loop (GHC.Err.error "invalid onReturn") inp buf end (Data.Map.Internal.Bin 1 Symantic.Parser.Grammar.Combinators.ExceptionFailure (onException callerInput) Data.Map.Internal.Tip Data.Map.Internal.Tip)
242 (Data.Map.Internal.Bin 1 Symantic.Parser.Grammar.Combinators.ExceptionFailure (onException callerInput) Data.Map.Internal.Tip Data.Map.Internal.Tip)
243 in let _ = "comment: look"
244 in let _ = "saveInput checkedHorizon=0"
245 in let _ = "comment: satisfy (GHC.Base.const GHC.Types.True)"
246 in let partialCont buf =
247 let readFail = onException callerInput
248 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=1"
249 in if readMore buf callerInput
255 #) = readNext buf callerInput
256 in let _ = "loadInput checkedHorizon=0"
257 in let partialCont buf =
258 let readFail = readFail
259 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=1"
260 in if readMore buf callerInput
262 if (\x -> (GHC.Classes.==) '<' x) c
264 let _ = "choicesBranch checkedHorizon=1"
265 in let _ = "pushValue"
266 in let _ = "comment: satisfy (GHC.Base.const GHC.Types.True)"
267 in let _ = "checkHorizon.oldCheck: checkedHorizon=1"
268 in let _ = "checkToken"
272 #) = readNext buf callerInput
273 in let _ = "lift2Value checkedHorizon=0"
277 Data.Set.Internal.empty
278 ( let _ = "resume.genCode"
279 in Parsers.Brainfuck.Types.Backward
285 let _ = "choicesBranch.else"
286 in if (\x -> (GHC.Classes.==) '>' x) c
288 let _ = "choicesBranch checkedHorizon=1"
289 in let _ = "pushValue"
290 in let _ = "comment: satisfy (GHC.Base.const GHC.Types.True)"
291 in let _ = "checkHorizon.oldCheck: checkedHorizon=1"
292 in let _ = "checkToken"
296 #) = readNext buf callerInput
297 in let _ = "lift2Value checkedHorizon=0"
301 Data.Set.Internal.empty
302 ( let _ = "resume.genCode"
303 in Parsers.Brainfuck.Types.Forward
309 let _ = "choicesBranch.else"
310 in if (\x -> (GHC.Classes.==) '+' x) c
312 let _ = "choicesBranch checkedHorizon=1"
313 in let _ = "pushValue"
314 in let _ = "comment: satisfy (GHC.Base.const GHC.Types.True)"
315 in let _ = "checkHorizon.oldCheck: checkedHorizon=1"
316 in let _ = "checkToken"
320 #) = readNext buf callerInput
321 in let _ = "lift2Value checkedHorizon=0"
325 Data.Set.Internal.empty
326 ( let _ = "resume.genCode"
327 in Parsers.Brainfuck.Types.Increment
333 let _ = "choicesBranch.else"
334 in if (\x -> (GHC.Classes.==) '-' x) c
336 let _ = "choicesBranch checkedHorizon=1"
337 in let _ = "pushValue"
338 in let _ = "comment: satisfy (GHC.Base.const GHC.Types.True)"
339 in let _ = "checkHorizon.oldCheck: checkedHorizon=1"
340 in let _ = "checkToken"
344 #) = readNext buf callerInput
345 in let _ = "lift2Value checkedHorizon=0"
349 Data.Set.Internal.empty
350 ( let _ = "resume.genCode"
351 in Parsers.Brainfuck.Types.Decrement
357 let _ = "choicesBranch.else"
358 in if (\x -> (GHC.Classes.==) ',' x) c
360 let _ = "choicesBranch checkedHorizon=1"
361 in let _ = "pushValue"
362 in let _ = "comment: satisfy (GHC.Base.const GHC.Types.True)"
363 in let _ = "checkHorizon.oldCheck: checkedHorizon=1"
364 in let _ = "checkToken"
368 #) = readNext buf callerInput
369 in let _ = "lift2Value checkedHorizon=0"
373 Data.Set.Internal.empty
374 ( let _ = "resume.genCode"
375 in Parsers.Brainfuck.Types.Input
381 let _ = "choicesBranch.else"
382 in if (\x -> (GHC.Classes.==) '.' x) c
384 let _ = "choicesBranch checkedHorizon=1"
385 in let _ = "pushValue"
386 in let _ = "comment: satisfy (GHC.Base.const GHC.Types.True)"
387 in let _ = "checkHorizon.oldCheck: checkedHorizon=1"
388 in let _ = "checkToken"
392 #) = readNext buf callerInput
393 in let _ = "lift2Value checkedHorizon=0"
397 Data.Set.Internal.empty
398 ( let _ = "resume.genCode"
399 in Parsers.Brainfuck.Types.Output
405 let _ = "choicesBranch.else"
406 in if (\x -> (GHC.Classes.==) '[' x) c
408 let _ = "choicesBranch checkedHorizon=1"
409 in let _ = "pushValue"
410 in let _ = "comment: satisfy (GHC.Base.const GHC.Types.True)"
411 in let _ = "checkHorizon.oldCheck: checkedHorizon=1"
412 in let _ = "checkToken"
416 #) = readNext buf callerInput
417 in let _ = "lift2Value checkedHorizon=0"
420 in \farInp farExp v (!inp) buf end ->
421 let _ = "lift2Value checkedHorizon=0"
424 in \farInp farExp v (!inp) buf end ->
425 let _ = "lift2Value checkedHorizon=0"
426 in let _ = "comment: satisfy ((GHC.Classes.==) ']')"
427 in let partialCont buf =
428 let readFail = readFail
429 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=1"
430 in if readMore buf inp
436 #) = readNext buf inp
437 in if (GHC.Classes.==) ']' c
439 let _ = "lift2Value checkedHorizon=1"
444 ( let _ = "resume.genCode"
445 in Parsers.Brainfuck.Types.Loop v
451 let _ = "checkToken.fail"
452 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure inp farInp farExp buf end
454 let _ = "checkHorizon.newCheck.fail"
457 Data.Set.Internal.Bin
459 ( Symantic.Parser.Grammar.Combinators.SomeFailure
461 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
464 Data.Set.Internal.Tip
465 Data.Set.Internal.Tip
469 #) = case GHC.Classes.compare @GHC.Types.Int farInp inp of
478 failExp GHC.Base.<> farExp
485 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure inp farInp farExp buf GHC.Types.True
489 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
490 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
492 if Symantic.Parser.Machine.Input.nullInput newInput
494 else partialCont (append buf newInput)
502 (Data.Map.Internal.Bin 1 Symantic.Parser.Grammar.Combinators.ExceptionFailure readFail Data.Map.Internal.Tip Data.Map.Internal.Tip)
507 (Data.Map.Internal.Bin 1 Symantic.Parser.Grammar.Combinators.ExceptionFailure readFail Data.Map.Internal.Tip Data.Map.Internal.Tip)
509 let _ = "choicesBranch.else"
510 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
514 #) = case GHC.Classes.compare @GHC.Types.Int initPos callerInput of
523 failExp GHC.Base.<> Data.Set.Internal.empty
528 Data.Set.Internal.empty
530 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure callerInput farInp farExp buf callerEnded
532 let _ = "checkHorizon.newCheck.fail"
535 Data.Set.Internal.Bin
537 ( Symantic.Parser.Grammar.Combinators.SomeFailure
539 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
542 Data.Set.Internal.Tip
543 Data.Set.Internal.Tip
547 #) = case GHC.Classes.compare @GHC.Types.Int initPos callerInput of
556 failExp GHC.Base.<> Data.Set.Internal.empty
561 Data.Set.Internal.empty
563 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure callerInput farInp farExp buf GHC.Types.True
567 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
568 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
570 if Symantic.Parser.Machine.Input.nullInput newInput
572 else partialCont (append buf newInput)
577 let _ = "checkHorizon.newCheck.fail"
580 Data.Set.Internal.Bin
582 ( Symantic.Parser.Grammar.Combinators.SomeFailure
584 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
587 Data.Set.Internal.Tip
588 Data.Set.Internal.Tip
592 #) = case GHC.Classes.compare @GHC.Types.Int initPos callerInput of
601 failExp GHC.Base.<> Data.Set.Internal.empty
606 Data.Set.Internal.empty
608 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure callerInput farInp farExp buf GHC.Types.True
612 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
613 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
615 if Symantic.Parser.Machine.Input.nullInput newInput
617 else partialCont (append buf newInput)
620 in partialCont callerBuffer
622 in loop callerOnReturn callerInput callerBuffer callerEnd (Data.Map.Internal.Bin 1 Symantic.Parser.Grammar.Combinators.ExceptionFailure (Data.Map.Strict.Internal.findWithDefault (Symantic.Parser.Machine.Generate.unForallOnException finalRaise) Symantic.Parser.Grammar.Combinators.ExceptionFailure callerOnExceptionStackByLabel) Data.Map.Internal.Tip Data.Map.Internal.Tip)
623 in let _ = "pushValue"
626 in \farInp farExp v (!inp) buf end ->
627 let _ = "lift2Value checkedHorizon=0"
630 in \farInp farExp v (!inp) buf end ->
631 let _ = "lift2Value checkedHorizon=0"
636 ( let _ = "resume.genCode"
646 Data.Map.Internal.Tip
651 Data.Map.Internal.Tip