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=4"
82 in if readMore buf ((GHC.Num.+) @GHC.Types.Int 3 initPos)
84 let name = \(!callerOnReturn) (!callerInput) (!callerBuffer) (!callerEnd) (!callerOnExceptionStackByLabel) ->
85 let _ = "catch ExceptionFailure checkedHorizon=0"
88 in \(!_exn) (!failInp) (!farInp) (!farExp) buf end ->
89 let _ = "loadInput checkedHorizon=0"
90 in let _ = "checkHorizon.noCheck"
91 in Data.Map.Strict.Internal.findWithDefault (Symantic.Parser.Machine.Generate.unForallOnException finalRaise) Symantic.Parser.Grammar.Combinators.ExceptionFailure callerOnExceptionStackByLabel Symantic.Parser.Grammar.Combinators.ExceptionFailure callerInput farInp farExp buf end
92 in let _ = "pushValue"
93 in let _ = "comment: satisfy ((GHC.Classes.==) 'a')"
94 in let partialCont buf =
95 let readFail = onException
96 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=4"
97 in if readMore buf ((GHC.Num.+) @GHC.Types.Int 3 callerInput)
103 #) = readNext buf callerInput
104 in if (GHC.Classes.==) 'a' c
106 let _ = "lift2Value checkedHorizon=4"
107 in let _ = "comment: satisfy ((GHC.Classes.==) 'b')"
108 in let _ = "checkHorizon.oldCheck: checkedHorizon=4"
109 in let _ = "checkToken"
114 in if (GHC.Classes.==) 'b' c
116 let _ = "lift2Value checkedHorizon=3"
117 in let _ = "comment: satisfy ((GHC.Classes.==) 'c')"
118 in let _ = "checkHorizon.oldCheck: checkedHorizon=3"
119 in let _ = "checkToken"
124 in if (GHC.Classes.==) 'c' c
126 let _ = "lift2Value checkedHorizon=2"
127 in let _ = "comment: satisfy ((GHC.Classes.==) 'd')"
128 in let _ = "checkHorizon.oldCheck: checkedHorizon=2"
129 in let _ = "checkToken"
134 in if (GHC.Classes.==) 'd' c
136 let _ = "lift2Value checkedHorizon=1"
141 Data.Set.Internal.empty
142 ( let _ = "resume.genCode"
143 in (GHC.Types.:) 'a' ((GHC.Types.:) 'b' ((GHC.Types.:) 'c' ((GHC.Types.:) 'd' GHC.Types . [])))
149 let _ = "checkToken.fail"
151 Data.Set.Internal.Bin
153 ( Symantic.Parser.Grammar.Combinators.SomeFailure
155 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'd'
158 Data.Set.Internal.Tip
159 Data.Set.Internal.Tip
163 #) = case GHC.Classes.compare @GHC.Types.Int initPos cs of
172 failExp GHC.Base.<> Data.Set.Internal.empty
177 Data.Set.Internal.empty
179 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure cs farInp farExp buf callerEnd
181 let _ = "checkToken.fail"
183 Data.Set.Internal.Bin
185 ( Symantic.Parser.Grammar.Combinators.SomeFailure
187 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'c'
190 Data.Set.Internal.Tip
191 Data.Set.Internal.Tip
195 #) = case GHC.Classes.compare @GHC.Types.Int initPos cs of
204 failExp GHC.Base.<> Data.Set.Internal.empty
209 Data.Set.Internal.empty
211 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure cs farInp farExp buf callerEnd
213 let _ = "checkToken.fail"
215 Data.Set.Internal.Bin
217 ( Symantic.Parser.Grammar.Combinators.SomeFailure
219 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'b'
222 Data.Set.Internal.Tip
223 Data.Set.Internal.Tip
227 #) = case GHC.Classes.compare @GHC.Types.Int initPos cs of
236 failExp GHC.Base.<> Data.Set.Internal.empty
241 Data.Set.Internal.empty
243 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure cs farInp farExp buf callerEnd
245 let _ = "checkToken.fail"
247 Data.Set.Internal.Bin
249 ( Symantic.Parser.Grammar.Combinators.SomeFailure
251 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
254 Data.Set.Internal.Tip
255 Data.Set.Internal.Tip
259 #) = case GHC.Classes.compare @GHC.Types.Int initPos callerInput of
268 failExp GHC.Base.<> Data.Set.Internal.empty
273 Data.Set.Internal.empty
275 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure callerInput farInp farExp buf callerEnd
277 let _ = "checkHorizon.newCheck.fail"
280 Data.Set.Internal.Bin
282 ( Symantic.Parser.Grammar.Combinators.SomeFailure
284 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 4
287 Data.Set.Internal.Tip
288 Data.Set.Internal.Tip
292 #) = case GHC.Classes.compare @GHC.Types.Int initPos callerInput of
301 failExp GHC.Base.<> Data.Set.Internal.empty
306 Data.Set.Internal.empty
308 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure callerInput farInp farExp buf GHC.Types.True
312 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
313 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
315 if Symantic.Parser.Machine.Input.nullInput newInput
317 else partialCont (append buf newInput)
320 in partialCont callerBuffer
321 in let _ = "pushValue"
324 in \farInp farExp v (!inp) buf end ->
325 let _ = "lift2Value checkedHorizon=0"
326 in let _ = "pushValue"
329 reg <- GHC.STRef.newSTRef dupv
331 in let onException loopInput =
332 let _ = "onException"
333 in \(!_exn) (!failInp) (!farInp) (!farExp) buf end ->
334 let _ = "comment: raiseAgainIfConsumed"
335 in let _ = "saveInput checkedHorizon=0"
336 in let _ = "lift2Value checkedHorizon=0"
337 in if (GHC.Classes.==) @GHC.Types.Int loopInput failInp
339 let _ = "choicesBranch checkedHorizon=0"
341 sr <- GHC.STRef.readSTRef reg
343 in let _ = "lift2Value checkedHorizon=0"
344 in let _ = "lift2Value checkedHorizon=0"
345 in let join = \farInp farExp v (!inp) buf end ->
346 let _ = "lift2Value checkedHorizon=0"
351 ( let _ = "resume.genCode"
352 in GHC.Show.show ((GHC.Types.:) v (sr GHC.Types . []))
357 in let _ = "catch ExceptionFailure checkedHorizon=0"
359 let _ = "onException"
360 in \(!_exn) (!failInp) (!farInp) (!farExp) buf end ->
361 let _ = "comment: raiseAgainIfConsumed"
362 in let _ = "saveInput checkedHorizon=0"
363 in let _ = "lift2Value checkedHorizon=0"
364 in if (GHC.Classes.==) @GHC.Types.Int failInp failInp
366 let _ = "choicesBranch checkedHorizon=0"
367 in let _ = "comment: eof.fail"
368 in let failExp = Data.Set.Internal.Bin 1 (Symantic.Parser.Grammar.Combinators.SomeFailure Symantic.Parser.Grammar.Combinators.FailureEnd) Data.Set.Internal.Tip Data.Set.Internal.Tip
372 #) = case GHC.Classes.compare @GHC.Types.Int farInp failInp of
381 failExp GHC.Base.<> farExp
388 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
390 let _ = "choicesBranch.else"
391 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
392 in let _ = "comment: negLook"
393 in let _ = "catch ExceptionFailure checkedHorizon=0"
395 let _ = "onException"
396 in \(!_exn) (!failInp) (!farInp) (!farExp) buf end ->
397 let _ = "comment: negLook.reset"
398 in let _ = "loadInput checkedHorizon=0"
399 in let _ = "checkHorizon.noCheck"
400 in let _ = "pushValue"
406 ( let _ = "resume.genCode"
412 in let _ = "comment: negLook.ahead"
413 in let _ = "saveInput checkedHorizon=0"
414 in let _ = "comment: satisfy (GHC.Base.const GHC.Types.True)"
415 in let partialCont buf =
416 let readFail = onException
417 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=1"
418 in if readMore buf failInp
424 #) = readNext buf failInp
425 in let _ = "popValue"
427 in let _ = "loadInput checkedHorizon=0"
428 in let _ = "checkHorizon.noCheck"
429 in onException Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
431 let _ = "checkHorizon.newCheck.fail"
434 Data.Set.Internal.Bin
436 ( Symantic.Parser.Grammar.Combinators.SomeFailure
438 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
441 Data.Set.Internal.Tip
442 Data.Set.Internal.Tip
446 #) = case GHC.Classes.compare @GHC.Types.Int farInp failInp of
455 failExp GHC.Base.<> farExp
462 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf GHC.Types.True
466 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
467 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
469 if Symantic.Parser.Machine.Input.nullInput newInput
471 else partialCont (append buf newInput)
476 let _ = "choicesBranch.else"
477 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
478 loop = \_callerOnReturn callerInput callerBuffer callerEnded callerOnExceptionStackByLabel ->
482 in \farInp farExp v (!inp) buf end ->
483 let _ = "lift2Value checkedHorizon=0"
484 in let _ = "pushValue"
485 in let _ = "lift2Value checkedHorizon=0"
487 sr <- GHC.STRef.readSTRef reg
488 let _ = "lift2Value checkedHorizon=0"
490 let dupv = \u -> sr ((GHC.Types.:) v u)
491 GHC.STRef.writeSTRef reg dupv
493 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)
498 (Data.Map.Internal.Bin 1 Symantic.Parser.Grammar.Combinators.ExceptionFailure (onException callerInput) Data.Map.Internal.Tip Data.Map.Internal.Tip)
500 in loop finalRet inp buf end Data.Map.Internal.Tip
505 Data.Map.Internal.Tip
507 let _ = "checkHorizon.newCheck.fail"
510 Data.Set.Internal.Bin
512 ( Symantic.Parser.Grammar.Combinators.SomeFailure
514 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 4
517 Data.Set.Internal.Tip
518 Data.Set.Internal.Tip
522 #) = case GHC.Classes.compare @GHC.Types.Int initPos initPos of
531 failExp GHC.Base.<> Data.Set.Internal.empty
536 Data.Set.Internal.empty
538 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure initPos farInp farExp buf GHC.Types.True
539 in if GHC.Types.False
542 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
543 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
545 if Symantic.Parser.Machine.Input.nullInput newInput
547 else partialCont (append buf newInput)
550 in partialCont initBuffer