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.==) 'a')"
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.==) 'a' c
129 let _ = "lift2Value checkedHorizon=2"
130 in let _ = "comment: satisfy ((GHC.Classes.==) 'b')"
131 in let _ = "checkHorizon.oldCheck: checkedHorizon=2"
132 in let _ = "checkToken"
137 in if (GHC.Classes.==) 'b' c
139 let _ = "lift2Value checkedHorizon=1"
145 ( let _ = "resume.genCode"
146 in (GHC.Types.:) 'a' ((GHC.Types.:) 'b' 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 'b'
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 'a'
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.==) 'a')"
282 in let _ = "checkHorizon.oldCheck: checkedHorizon=1"
283 in let _ = "checkToken"
288 in if (GHC.Classes.==) 'a' c
290 let _ = "lift2Value checkedHorizon=0"
296 Data.Set.Internal.empty
297 ( let _ = "resume.genCode"
298 in (GHC.Types.:) 'a' ((GHC.Types.:) 'a' GHC.Types . [])
304 let _ = "checkToken.fail"
306 Data.Set.Internal.Bin
308 ( Symantic.Parser.Grammar.Combinators.SomeFailure
310 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
313 Data.Set.Internal.Tip
314 Data.Set.Internal.Tip
318 #) = case GHC.Classes.compare @GHC.Types.Int initPos cs of
327 failExp GHC.Base.<> Data.Set.Internal.empty
332 Data.Set.Internal.empty
334 in onException Symantic.Parser.Grammar.Combinators.ExceptionFailure cs farInp farExp buf GHC.Types.False
336 let _ = "checkToken.fail"
338 Data.Set.Internal.Bin
340 ( Symantic.Parser.Grammar.Combinators.SomeFailure
342 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
345 Data.Set.Internal.Tip
346 Data.Set.Internal.Tip
350 #) = case GHC.Classes.compare @GHC.Types.Int initPos initPos of
359 failExp GHC.Base.<> Data.Set.Internal.empty
364 Data.Set.Internal.empty
366 in onException Symantic.Parser.Grammar.Combinators.ExceptionFailure initPos farInp farExp buf GHC.Types.False
368 let _ = "checkHorizon.newCheck.fail"
371 Data.Set.Internal.Bin
373 ( Symantic.Parser.Grammar.Combinators.SomeFailure
375 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 2
378 Data.Set.Internal.Tip
379 Data.Set.Internal.Tip
383 #) = case GHC.Classes.compare @GHC.Types.Int initPos initPos of
392 failExp GHC.Base.<> Data.Set.Internal.empty
397 Data.Set.Internal.empty
399 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure initPos farInp farExp buf GHC.Types.True
400 in if GHC.Types.False
403 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
404 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
406 if Symantic.Parser.Machine.Input.nullInput newInput
408 else partialCont (append buf newInput)
411 in partialCont initBuffer