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 _ = "checkHorizon.noCheck"
81 in let _ = "pushValue"
82 in let _ = "pushValue"
85 reg <- GHC.STRef.newSTRef dupv
87 in let onException loopInput =
89 in \(!_exn) (!failInp) (!farInp) (!farExp) buf end ->
90 let _ = "comment: raiseAgainIfConsumed"
91 in let _ = "saveInput checkedHorizon=0"
92 in let _ = "lift2Value checkedHorizon=0"
93 in if (GHC.Classes.==) @GHC.Types.Int loopInput failInp
95 let _ = "choicesBranch checkedHorizon=0"
97 sr <- GHC.STRef.readSTRef reg
99 in let _ = "lift2Value checkedHorizon=0"
100 in let _ = "lift2Value checkedHorizon=0"
101 in let join = \farInp farExp v (!inp) buf end ->
102 let _ = "lift2Value checkedHorizon=0"
107 ( let _ = "resume.genCode"
108 in GHC.Show.show (sr GHC.Types . [])
113 in let _ = "catch ExceptionFailure checkedHorizon=0"
115 let _ = "onException"
116 in \(!_exn) (!failInp) (!farInp) (!farExp) buf end ->
117 let _ = "comment: raiseAgainIfConsumed"
118 in let _ = "saveInput checkedHorizon=0"
119 in let _ = "lift2Value checkedHorizon=0"
120 in if (GHC.Classes.==) @GHC.Types.Int failInp failInp
122 let _ = "choicesBranch checkedHorizon=0"
123 in let _ = "comment: eof.fail"
124 in let failExp = Data.Set.Internal.Bin 1 (Symantic.Parser.Grammar.Combinators.SomeFailure Symantic.Parser.Grammar.Combinators.FailureEnd) Data.Set.Internal.Tip Data.Set.Internal.Tip
128 #) = case GHC.Classes.compare @GHC.Types.Int farInp failInp of
137 failExp GHC.Base.<> farExp
144 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
146 let _ = "choicesBranch.else"
147 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
148 in let _ = "comment: negLook"
149 in let _ = "catch ExceptionFailure checkedHorizon=0"
151 let _ = "onException"
152 in \(!_exn) (!failInp) (!farInp) (!farExp) buf end ->
153 let _ = "comment: negLook.reset"
154 in let _ = "loadInput checkedHorizon=0"
155 in let _ = "checkHorizon.noCheck"
156 in let _ = "pushValue"
162 ( let _ = "resume.genCode"
168 in let _ = "comment: negLook.ahead"
169 in let _ = "saveInput checkedHorizon=0"
170 in let _ = "comment: satisfy (GHC.Base.const GHC.Types.True)"
171 in let partialCont buf =
172 let readFail = onException
173 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=1"
174 in if readMore buf failInp
180 #) = readNext buf failInp
181 in let _ = "popValue"
183 in let _ = "loadInput checkedHorizon=0"
184 in let _ = "checkHorizon.noCheck"
185 in onException Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
187 let _ = "checkHorizon.newCheck.fail"
190 Data.Set.Internal.Bin
192 ( Symantic.Parser.Grammar.Combinators.SomeFailure
194 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
197 Data.Set.Internal.Tip
198 Data.Set.Internal.Tip
202 #) = case GHC.Classes.compare @GHC.Types.Int farInp failInp of
211 failExp GHC.Base.<> farExp
218 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf GHC.Types.True
222 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
223 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
225 if Symantic.Parser.Machine.Input.nullInput newInput
227 else partialCont (append buf newInput)
232 let _ = "choicesBranch.else"
233 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
234 loop = \_callerOnReturn callerInput callerBuffer callerEnded callerOnExceptionStackByLabel ->
236 in let _ = "comment: satisfy (\\t_0 -> ('a' GHC.Classes.== t_0) GHC.Classes.|| (('b' GHC.Classes.== t_0) GHC.Classes.|| (('c' GHC.Classes.== t_0) GHC.Classes.|| (('d' GHC.Classes.== t_0) GHC.Classes.|| GHC.Types.False))))"
237 in let partialCont buf =
238 let readFail = onException callerInput
239 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=1"
240 in if readMore buf callerInput
246 #) = readNext buf callerInput
247 in if (\t -> ('a' GHC.Classes.== t) GHC.Classes.|| (('b' GHC.Classes.== t) GHC.Classes.|| (('c' GHC.Classes.== t) GHC.Classes.|| (('d' GHC.Classes.== t) GHC.Classes.|| GHC.Types.False)))) c
249 let _ = "lift2Value checkedHorizon=1"
250 in let _ = "pushValue"
251 in let _ = "lift2Value checkedHorizon=1"
253 sr <- GHC.STRef.readSTRef reg
254 let _ = "lift2Value checkedHorizon=1"
256 let dupv = \u -> sr ((GHC.Types.:) c u)
257 GHC.STRef.writeSTRef reg dupv
259 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)
261 let _ = "checkToken.fail"
263 Data.Set.Internal.Bin
265 ( Symantic.Parser.Grammar.Combinators.SomeFailure
267 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'b'
270 ( Data.Set.Internal.Bin
272 ( Symantic.Parser.Grammar.Combinators.SomeFailure
274 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
277 Data.Set.Internal.Tip
278 Data.Set.Internal.Tip
280 ( Data.Set.Internal.Bin
282 ( Symantic.Parser.Grammar.Combinators.SomeFailure
284 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'c'
287 Data.Set.Internal.Tip
288 ( Data.Set.Internal.Bin
290 ( Symantic.Parser.Grammar.Combinators.SomeFailure
292 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'd'
295 Data.Set.Internal.Tip
296 Data.Set.Internal.Tip
302 #) = case GHC.Classes.compare @GHC.Types.Int initPos callerInput of
311 failExp GHC.Base.<> Data.Set.Internal.empty
316 Data.Set.Internal.empty
318 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure callerInput farInp farExp buf callerEnded
320 let _ = "checkHorizon.newCheck.fail"
323 Data.Set.Internal.Bin
325 ( Symantic.Parser.Grammar.Combinators.SomeFailure
327 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
330 Data.Set.Internal.Tip
331 Data.Set.Internal.Tip
335 #) = case GHC.Classes.compare @GHC.Types.Int initPos callerInput of
344 failExp GHC.Base.<> Data.Set.Internal.empty
349 Data.Set.Internal.empty
351 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure callerInput farInp farExp buf GHC.Types.True
355 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
356 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
358 if Symantic.Parser.Machine.Input.nullInput newInput
360 else partialCont (append buf newInput)
363 in partialCont callerBuffer
365 in loop finalRet initPos initBuffer GHC.Types.False Data.Map.Internal.Tip