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 _ = "loadInput checkedHorizon=0"
113 in let _ = "checkHorizon.noCheck"
114 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
115 in let _ = "pushValue"
116 in let _ = "comment: satisfy ((GHC.Classes.==) 'd')"
117 in let partialCont buf =
118 let readFail = onException
119 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=2"
120 in if readMore buf ((GHC.Num.+) @GHC.Types.Int 1 failInp)
126 #) = readNext buf failInp
127 in if (GHC.Classes.==) 'd' c
129 let _ = "lift2Value checkedHorizon=2"
130 in let _ = "comment: satisfy ((GHC.Classes.==) 'e')"
131 in let _ = "checkHorizon.oldCheck: checkedHorizon=2"
132 in let _ = "checkToken"
137 in if (GHC.Classes.==) 'e' c
139 let _ = "lift2Value checkedHorizon=1"
145 ( let _ = "resume.genCode"
146 in (GHC.Types.:) 'd' ((GHC.Types.:) 'e' GHC.Types . [])
152 let _ = "checkToken.fail"
154 Data.Set.Internal.Bin
156 ( Symantic.Parser.Grammar.Combinators.SomeFailure
158 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'e'
161 Data.Set.Internal.Tip
162 Data.Set.Internal.Tip
166 #) = case GHC.Classes.compare @GHC.Types.Int farInp cs of
175 failExp GHC.Base.<> farExp
182 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure cs farInp farExp buf end
184 let _ = "checkToken.fail"
186 Data.Set.Internal.Bin
188 ( Symantic.Parser.Grammar.Combinators.SomeFailure
190 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'd'
193 Data.Set.Internal.Tip
194 Data.Set.Internal.Tip
198 #) = case GHC.Classes.compare @GHC.Types.Int farInp failInp of
207 failExp GHC.Base.<> farExp
214 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
216 let _ = "checkHorizon.newCheck.fail"
219 Data.Set.Internal.Bin
221 ( Symantic.Parser.Grammar.Combinators.SomeFailure
223 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 2
226 Data.Set.Internal.Tip
227 Data.Set.Internal.Tip
231 #) = case GHC.Classes.compare @GHC.Types.Int farInp failInp of
240 failExp GHC.Base.<> farExp
247 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf GHC.Types.True
251 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
252 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
254 if Symantic.Parser.Machine.Input.nullInput newInput
256 else partialCont (append buf newInput)
261 let _ = "choicesBranch.else"
262 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
263 in let _ = "catch ExceptionFailure checkedHorizon=2"
265 let _ = "onException"
266 in \(!_exn) (!failInp) (!farInp) (!farExp) buf end ->
267 let _ = "loadInput checkedHorizon=2"
268 in let _ = "checkHorizon.oldCheck: checkedHorizon=2"
269 in onException Symantic.Parser.Grammar.Combinators.ExceptionFailure initPos farInp farExp buf end
270 in let _ = "pushValue"
271 in let _ = "comment: satisfy ((GHC.Classes.==) 'a')"
272 in let _ = "checkHorizon.oldCheck: checkedHorizon=2"
273 in let _ = "checkToken"
277 #) = readNext buf initPos
278 in if (GHC.Classes.==) 'a' c
280 let _ = "lift2Value checkedHorizon=1"
281 in let _ = "comment: satisfy ((GHC.Classes.==) 'b')"
282 in let _ = "checkHorizon.oldCheck: checkedHorizon=1"
283 in let _ = "checkToken"
288 in if (GHC.Classes.==) 'b' c
290 let _ = "lift2Value checkedHorizon=0"
291 in let _ = "comment: satisfy ((GHC.Classes.==) 'c')"
292 in let partialCont buf =
293 let readFail = onException
294 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=1"
295 in if readMore buf cs
302 in if (GHC.Classes.==) 'c' c
304 let _ = "lift2Value checkedHorizon=1"
310 Data.Set.Internal.empty
311 ( let _ = "resume.genCode"
312 in (GHC.Types.:) 'a' ((GHC.Types.:) 'b' ((GHC.Types.:) 'c' GHC.Types . []))
318 let _ = "checkToken.fail"
320 Data.Set.Internal.Bin
322 ( Symantic.Parser.Grammar.Combinators.SomeFailure
324 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'c'
327 Data.Set.Internal.Tip
328 Data.Set.Internal.Tip
332 #) = case GHC.Classes.compare @GHC.Types.Int initPos cs of
341 failExp GHC.Base.<> Data.Set.Internal.empty
346 Data.Set.Internal.empty
348 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure cs farInp farExp buf GHC.Types.False
350 let _ = "checkHorizon.newCheck.fail"
353 Data.Set.Internal.Bin
355 ( Symantic.Parser.Grammar.Combinators.SomeFailure
357 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
360 Data.Set.Internal.Tip
361 Data.Set.Internal.Tip
365 #) = case GHC.Classes.compare @GHC.Types.Int initPos cs of
374 failExp GHC.Base.<> Data.Set.Internal.empty
379 Data.Set.Internal.empty
381 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure cs farInp farExp buf GHC.Types.True
382 in if GHC.Types.False
385 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
386 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
388 if Symantic.Parser.Machine.Input.nullInput newInput
390 else partialCont (append buf newInput)
395 let _ = "checkToken.fail"
397 Data.Set.Internal.Bin
399 ( Symantic.Parser.Grammar.Combinators.SomeFailure
401 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'b'
404 Data.Set.Internal.Tip
405 Data.Set.Internal.Tip
409 #) = case GHC.Classes.compare @GHC.Types.Int initPos cs of
418 failExp GHC.Base.<> Data.Set.Internal.empty
423 Data.Set.Internal.empty
425 in onException Symantic.Parser.Grammar.Combinators.ExceptionFailure cs farInp farExp buf GHC.Types.False
427 let _ = "checkToken.fail"
429 Data.Set.Internal.Bin
431 ( Symantic.Parser.Grammar.Combinators.SomeFailure
433 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
436 Data.Set.Internal.Tip
437 Data.Set.Internal.Tip
441 #) = case GHC.Classes.compare @GHC.Types.Int initPos initPos of
450 failExp GHC.Base.<> Data.Set.Internal.empty
455 Data.Set.Internal.empty
457 in onException Symantic.Parser.Grammar.Combinators.ExceptionFailure initPos farInp farExp buf GHC.Types.False
459 let _ = "checkHorizon.newCheck.fail"
462 Data.Set.Internal.Bin
464 ( Symantic.Parser.Grammar.Combinators.SomeFailure
466 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 2
469 Data.Set.Internal.Tip
470 Data.Set.Internal.Tip
474 #) = case GHC.Classes.compare @GHC.Types.Int initPos initPos of
483 failExp GHC.Base.<> Data.Set.Internal.empty
488 Data.Set.Internal.empty
490 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure initPos farInp farExp buf GHC.Types.True
491 in if GHC.Types.False
494 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
495 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
497 if Symantic.Parser.Machine.Input.nullInput newInput
499 else partialCont (append buf newInput)
502 in partialCont initBuffer