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.==) 'c')"
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.==) 'c' 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 'c'
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 _ = "pushValue"
200 in let _ = "comment: satisfy ((GHC.Classes.==) 'b')"
201 in let partialCont buf =
202 let readFail = Symantic.Parser.Machine.Generate.unForallOnException finalRaise
203 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=2"
204 in if readMore buf ((GHC.Num.+) @GHC.Types.Int 1 failInp)
210 #) = readNext buf failInp
211 in if (GHC.Classes.==) 'b' c
213 let _ = "lift2Value checkedHorizon=2"
218 ( let _ = "resume.genCode"
225 let _ = "checkToken.fail"
227 Data.Set.Internal.Bin
229 ( Symantic.Parser.Grammar.Combinators.SomeFailure
231 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'b'
234 Data.Set.Internal.Tip
235 Data.Set.Internal.Tip
239 #) = case GHC.Classes.compare @GHC.Types.Int farInp failInp of
248 failExp GHC.Base.<> farExp
255 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
257 let _ = "checkHorizon.newCheck.fail"
260 Data.Set.Internal.Bin
262 ( Symantic.Parser.Grammar.Combinators.SomeFailure
264 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 2
267 Data.Set.Internal.Tip
268 Data.Set.Internal.Tip
272 #) = case GHC.Classes.compare @GHC.Types.Int farInp failInp of
281 failExp GHC.Base.<> farExp
288 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf GHC.Types.True
292 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
293 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
295 if Symantic.Parser.Machine.Input.nullInput newInput
297 else partialCont (append buf newInput)
302 let _ = "choicesBranch.else"
303 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
304 in let _ = "pushValue"
305 in let _ = "comment: satisfy ((GHC.Classes.==) 'a')"
306 in let _ = "checkHorizon.oldCheck: checkedHorizon=2"
307 in let _ = "checkToken"
311 #) = readNext buf initPos
312 in if (GHC.Classes.==) 'a' c
314 let _ = "lift2Value checkedHorizon=1"
319 Data.Set.Internal.empty
320 ( let _ = "resume.genCode"
327 let _ = "checkToken.fail"
329 Data.Set.Internal.Bin
331 ( Symantic.Parser.Grammar.Combinators.SomeFailure
333 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
336 Data.Set.Internal.Tip
337 Data.Set.Internal.Tip
341 #) = case GHC.Classes.compare @GHC.Types.Int initPos initPos of
350 failExp GHC.Base.<> Data.Set.Internal.empty
355 Data.Set.Internal.empty
357 in onException Symantic.Parser.Grammar.Combinators.ExceptionFailure initPos farInp farExp buf GHC.Types.False
359 let _ = "checkHorizon.newCheck.fail"
362 Data.Set.Internal.Bin
364 ( Symantic.Parser.Grammar.Combinators.SomeFailure
366 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 2
369 Data.Set.Internal.Tip
370 Data.Set.Internal.Tip
374 #) = case GHC.Classes.compare @GHC.Types.Int initPos initPos of
383 failExp GHC.Base.<> Data.Set.Internal.empty
388 Data.Set.Internal.empty
390 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure initPos farInp farExp buf GHC.Types.True
391 in if GHC.Types.False
394 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
395 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
397 if Symantic.Parser.Machine.Input.nullInput newInput
399 else partialCont (append buf newInput)
402 in partialCont initBuffer