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=1"
82 in if readMore buf initPos
85 in let _ = "pushValue"
86 in let _ = "pushValue"
89 reg <- GHC.STRef.newSTRef dupv
91 in let onException loopInput =
93 in \(!_exn) (!failInp) (!farInp) (!farExp) buf end ->
94 let _ = "comment: raiseAgainIfConsumed"
95 in let _ = "saveInput checkedHorizon=0"
96 in let _ = "lift2Value checkedHorizon=0"
97 in if (GHC.Classes.==) @GHC.Types.Int loopInput failInp
99 let _ = "choicesBranch checkedHorizon=0"
101 sr <- GHC.STRef.readSTRef reg
103 in let _ = "lift2Value checkedHorizon=0"
104 in let _ = "lift2Value checkedHorizon=0"
105 in let _ = "comment: satisfy ((GHC.Classes.==) 'b')"
106 in let partialCont buf =
107 let readFail = Symantic.Parser.Machine.Generate.unForallOnException finalRaise
108 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=1"
109 in if readMore buf failInp
115 #) = readNext buf failInp
116 in if (GHC.Classes.==) 'b' c
118 let _ = "lift2Value checkedHorizon=1"
123 ( let _ = "resume.genCode"
124 in GHC.Show.show (sr GHC.Types . [])
130 let _ = "checkToken.fail"
132 Data.Set.Internal.Bin
134 ( Symantic.Parser.Grammar.Combinators.SomeFailure
136 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'b'
139 Data.Set.Internal.Tip
140 Data.Set.Internal.Tip
144 #) = case GHC.Classes.compare @GHC.Types.Int farInp failInp of
153 failExp GHC.Base.<> farExp
160 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
162 let _ = "checkHorizon.newCheck.fail"
165 Data.Set.Internal.Bin
167 ( Symantic.Parser.Grammar.Combinators.SomeFailure
169 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
172 Data.Set.Internal.Tip
173 Data.Set.Internal.Tip
177 #) = case GHC.Classes.compare @GHC.Types.Int farInp failInp of
186 failExp GHC.Base.<> farExp
193 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf GHC.Types.True
197 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
198 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
200 if Symantic.Parser.Machine.Input.nullInput newInput
202 else partialCont (append buf newInput)
207 let _ = "choicesBranch.else"
208 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
209 loop = \_callerOnReturn callerInput callerBuffer callerEnded callerOnExceptionStackByLabel ->
211 in let _ = "comment: satisfy ((GHC.Classes.==) 'a')"
212 in let partialCont buf =
213 let readFail = onException callerInput
214 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=1"
215 in if readMore buf callerInput
221 #) = readNext buf callerInput
222 in if (GHC.Classes.==) 'a' c
224 let _ = "lift2Value checkedHorizon=1"
225 in let _ = "pushValue"
226 in let _ = "lift2Value checkedHorizon=1"
228 sr <- GHC.STRef.readSTRef reg
229 let _ = "lift2Value checkedHorizon=1"
231 let dupv = \u -> sr ((GHC.Types.:) 'a' u)
232 GHC.STRef.writeSTRef reg dupv
234 in loop (GHC.Err.error "invalid onReturn") cs buf callerEnded (Data.Map.Internal.Bin 1 Symantic.Parser.Grammar.Combinators.ExceptionFailure readFail Data.Map.Internal.Tip Data.Map.Internal.Tip)
236 let _ = "checkToken.fail"
238 Data.Set.Internal.Bin
240 ( Symantic.Parser.Grammar.Combinators.SomeFailure
242 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
245 Data.Set.Internal.Tip
246 Data.Set.Internal.Tip
250 #) = case GHC.Classes.compare @GHC.Types.Int initPos callerInput of
259 failExp GHC.Base.<> Data.Set.Internal.empty
264 Data.Set.Internal.empty
266 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure callerInput farInp farExp buf callerEnded
268 let _ = "checkHorizon.newCheck.fail"
271 Data.Set.Internal.Bin
273 ( Symantic.Parser.Grammar.Combinators.SomeFailure
275 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
278 Data.Set.Internal.Tip
279 Data.Set.Internal.Tip
283 #) = case GHC.Classes.compare @GHC.Types.Int initPos callerInput of
292 failExp GHC.Base.<> Data.Set.Internal.empty
297 Data.Set.Internal.empty
299 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure callerInput farInp farExp buf GHC.Types.True
303 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
304 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
306 if Symantic.Parser.Machine.Input.nullInput newInput
308 else partialCont (append buf newInput)
311 in partialCont callerBuffer
313 in loop finalRet initPos buf GHC.Types.False Data.Map.Internal.Tip
315 let _ = "checkHorizon.newCheck.fail"
318 Data.Set.Internal.Bin
320 ( Symantic.Parser.Grammar.Combinators.SomeFailure
322 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
325 Data.Set.Internal.Tip
326 Data.Set.Internal.Tip
330 #) = case GHC.Classes.compare @GHC.Types.Int initPos initPos of
339 failExp GHC.Base.<> Data.Set.Internal.empty
344 Data.Set.Internal.empty
346 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure initPos farInp farExp buf GHC.Types.True
347 in if GHC.Types.False
350 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
351 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
353 if Symantic.Parser.Machine.Input.nullInput newInput
355 else partialCont (append buf newInput)
358 in partialCont initBuffer