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"
88 in let _ = "comment: satisfy ((GHC.Classes.==) 'd')"
89 in let partialCont buf =
90 let readFail = Symantic.Parser.Machine.Generate.unForallOnException finalRaise
91 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=1"
92 in if readMore buf inp
99 in if (GHC.Classes.==) 'd' c
101 let _ = "lift2Value checkedHorizon=1"
106 ( let _ = "resume.genCode"
113 let _ = "checkToken.fail"
115 Data.Set.Internal.Bin
117 ( Symantic.Parser.Grammar.Combinators.SomeFailure
119 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'd'
122 Data.Set.Internal.Tip
123 Data.Set.Internal.Tip
127 #) = case GHC.Classes.compare @GHC.Types.Int farInp inp of
136 failExp GHC.Base.<> farExp
143 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure inp farInp farExp buf end
145 let _ = "checkHorizon.newCheck.fail"
148 Data.Set.Internal.Bin
150 ( Symantic.Parser.Grammar.Combinators.SomeFailure
152 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
155 Data.Set.Internal.Tip
156 Data.Set.Internal.Tip
160 #) = case GHC.Classes.compare @GHC.Types.Int farInp inp of
169 failExp GHC.Base.<> farExp
176 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure inp farInp farExp buf GHC.Types.True
180 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
181 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
183 if Symantic.Parser.Machine.Input.nullInput newInput
185 else partialCont (append buf newInput)
189 in let _ = "catch ExceptionFailure checkedHorizon=2"
191 let _ = "onException"
192 in \(!_exn) (!failInp) (!farInp) (!farExp) buf end ->
193 let _ = "comment: raiseAgainIfConsumed"
194 in let _ = "saveInput checkedHorizon=0"
195 in let _ = "lift2Value checkedHorizon=0"
196 in if (GHC.Classes.==) @GHC.Types.Int initPos failInp
198 let _ = "choicesBranch checkedHorizon=0"
199 in let _ = "catch ExceptionFailure checkedHorizon=0"
201 let _ = "onException"
202 in \(!_exn) (!failInp) (!farInp) (!farExp) buf end ->
203 let _ = "comment: raiseAgainIfConsumed"
204 in let _ = "saveInput checkedHorizon=0"
205 in let _ = "lift2Value checkedHorizon=0"
206 in if (GHC.Classes.==) @GHC.Types.Int failInp failInp
208 let _ = "choicesBranch checkedHorizon=0"
209 in let _ = "pushValue"
210 in let _ = "comment: satisfy ((GHC.Classes.==) 'c')"
211 in let partialCont buf =
212 let readFail = Symantic.Parser.Machine.Generate.unForallOnException finalRaise
213 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=2"
214 in if readMore buf ((GHC.Num.+) @GHC.Types.Int 1 failInp)
220 #) = readNext buf failInp
221 in if (GHC.Classes.==) 'c' c
223 let _ = "lift2Value checkedHorizon=2"
228 ( let _ = "resume.genCode"
235 let _ = "checkToken.fail"
237 Data.Set.Internal.Bin
239 ( Symantic.Parser.Grammar.Combinators.SomeFailure
241 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'c'
244 Data.Set.Internal.Tip
245 Data.Set.Internal.Tip
249 #) = case GHC.Classes.compare @GHC.Types.Int farInp failInp of
258 failExp GHC.Base.<> farExp
265 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
267 let _ = "checkHorizon.newCheck.fail"
270 Data.Set.Internal.Bin
272 ( Symantic.Parser.Grammar.Combinators.SomeFailure
274 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 2
277 Data.Set.Internal.Tip
278 Data.Set.Internal.Tip
282 #) = case GHC.Classes.compare @GHC.Types.Int farInp failInp of
291 failExp GHC.Base.<> farExp
298 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf GHC.Types.True
302 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
303 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
305 if Symantic.Parser.Machine.Input.nullInput newInput
307 else partialCont (append buf newInput)
312 let _ = "choicesBranch.else"
313 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
314 in let _ = "pushValue"
315 in let _ = "comment: satisfy ((GHC.Classes.==) 'b')"
316 in let partialCont buf =
317 let readFail = onException
318 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=2"
319 in if readMore buf ((GHC.Num.+) @GHC.Types.Int 1 failInp)
325 #) = readNext buf failInp
326 in if (GHC.Classes.==) 'b' c
328 let _ = "lift2Value checkedHorizon=2"
334 ( let _ = "resume.genCode"
341 let _ = "checkToken.fail"
343 Data.Set.Internal.Bin
345 ( Symantic.Parser.Grammar.Combinators.SomeFailure
347 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'b'
350 Data.Set.Internal.Tip
351 Data.Set.Internal.Tip
355 #) = case GHC.Classes.compare @GHC.Types.Int farInp failInp of
364 failExp GHC.Base.<> farExp
371 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
373 let _ = "checkHorizon.newCheck.fail"
376 Data.Set.Internal.Bin
378 ( Symantic.Parser.Grammar.Combinators.SomeFailure
380 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 2
383 Data.Set.Internal.Tip
384 Data.Set.Internal.Tip
388 #) = case GHC.Classes.compare @GHC.Types.Int farInp failInp of
397 failExp GHC.Base.<> farExp
404 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf GHC.Types.True
408 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
409 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
411 if Symantic.Parser.Machine.Input.nullInput newInput
413 else partialCont (append buf newInput)
418 let _ = "choicesBranch.else"
419 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
420 in let _ = "pushValue"
421 in let _ = "comment: satisfy ((GHC.Classes.==) 'a')"
422 in let _ = "checkHorizon.oldCheck: checkedHorizon=2"
423 in let _ = "checkToken"
427 #) = readNext buf initPos
428 in if (GHC.Classes.==) 'a' c
430 let _ = "lift2Value checkedHorizon=1"
435 Data.Set.Internal.empty
436 ( let _ = "resume.genCode"
443 let _ = "checkToken.fail"
445 Data.Set.Internal.Bin
447 ( Symantic.Parser.Grammar.Combinators.SomeFailure
449 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
452 Data.Set.Internal.Tip
453 Data.Set.Internal.Tip
457 #) = case GHC.Classes.compare @GHC.Types.Int initPos initPos of
466 failExp GHC.Base.<> Data.Set.Internal.empty
471 Data.Set.Internal.empty
473 in onException Symantic.Parser.Grammar.Combinators.ExceptionFailure initPos farInp farExp buf GHC.Types.False
475 let _ = "checkHorizon.newCheck.fail"
478 Data.Set.Internal.Bin
480 ( Symantic.Parser.Grammar.Combinators.SomeFailure
482 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 2
485 Data.Set.Internal.Tip
486 Data.Set.Internal.Tip
490 #) = case GHC.Classes.compare @GHC.Types.Int initPos initPos of
499 failExp GHC.Base.<> Data.Set.Internal.empty
504 Data.Set.Internal.empty
506 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure initPos farInp farExp buf GHC.Types.True
507 in if GHC.Types.False
510 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
511 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
513 if Symantic.Parser.Machine.Input.nullInput newInput
515 else partialCont (append buf newInput)
518 in partialCont initBuffer