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"
349 ( let _ = "resume.genCode"
350 in GHC.Show.show ((GHC.Types.:) v (sr GHC.Types . []))
356 let _ = "choicesBranch.else"
357 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
358 loop = \_callerOnReturn callerInput callerBuffer callerEnded callerOnExceptionStackByLabel ->
362 in \farInp farExp v (!inp) buf end ->
363 let _ = "lift2Value checkedHorizon=0"
364 in let _ = "pushValue"
365 in let _ = "lift2Value checkedHorizon=0"
367 sr <- GHC.STRef.readSTRef reg
368 let _ = "lift2Value checkedHorizon=0"
370 let dupv = \u -> sr ((GHC.Types.:) v u)
371 GHC.STRef.writeSTRef reg dupv
373 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)
378 (Data.Map.Internal.Bin 1 Symantic.Parser.Grammar.Combinators.ExceptionFailure (onException callerInput) Data.Map.Internal.Tip Data.Map.Internal.Tip)
380 in loop finalRet inp buf end Data.Map.Internal.Tip
385 Data.Map.Internal.Tip
387 let _ = "checkHorizon.newCheck.fail"
390 Data.Set.Internal.Bin
392 ( Symantic.Parser.Grammar.Combinators.SomeFailure
394 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 4
397 Data.Set.Internal.Tip
398 Data.Set.Internal.Tip
402 #) = case GHC.Classes.compare @GHC.Types.Int initPos initPos of
411 failExp GHC.Base.<> Data.Set.Internal.empty
416 Data.Set.Internal.empty
418 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure initPos farInp farExp buf GHC.Types.True
419 in if GHC.Types.False
422 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
423 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
425 if Symantic.Parser.Machine.Input.nullInput newInput
427 else partialCont (append buf newInput)
430 in partialCont initBuffer