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 _ = "pushValue"
109 in let _ = "comment: satisfy ((GHC.Classes.==) 'a')"
110 in let partialCont buf =
111 let readFail = Symantic.Parser.Machine.Generate.unForallOnException finalRaise
112 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=2"
113 in if readMore buf ((GHC.Num.+) @GHC.Types.Int 1 failInp)
119 #) = readNext buf failInp
120 in if (GHC.Classes.==) 'a' c
122 let _ = "lift2Value checkedHorizon=2"
123 in let _ = "comment: satisfy ((GHC.Classes.==) 'b')"
124 in let _ = "checkHorizon.oldCheck: checkedHorizon=2"
125 in let _ = "checkToken"
130 in if (GHC.Classes.==) 'b' c
132 let _ = "lift2Value checkedHorizon=1"
137 ( let _ = "resume.genCode"
138 in (GHC.Types.:) 'a' ((GHC.Types.:) 'b' GHC.Types . [])
144 let _ = "checkToken.fail"
146 Data.Set.Internal.Bin
148 ( Symantic.Parser.Grammar.Combinators.SomeFailure
150 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'b'
153 Data.Set.Internal.Tip
154 Data.Set.Internal.Tip
158 #) = case GHC.Classes.compare @GHC.Types.Int farInp cs of
167 failExp GHC.Base.<> farExp
174 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure cs farInp farExp buf end
176 let _ = "checkToken.fail"
178 Data.Set.Internal.Bin
180 ( Symantic.Parser.Grammar.Combinators.SomeFailure
182 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
185 Data.Set.Internal.Tip
186 Data.Set.Internal.Tip
190 #) = case GHC.Classes.compare @GHC.Types.Int farInp failInp of
199 failExp GHC.Base.<> farExp
206 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
208 let _ = "checkHorizon.newCheck.fail"
211 Data.Set.Internal.Bin
213 ( Symantic.Parser.Grammar.Combinators.SomeFailure
215 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 2
218 Data.Set.Internal.Tip
219 Data.Set.Internal.Tip
223 #) = case GHC.Classes.compare @GHC.Types.Int farInp failInp of
232 failExp GHC.Base.<> farExp
239 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf GHC.Types.True
243 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
244 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
246 if Symantic.Parser.Machine.Input.nullInput newInput
248 else partialCont (append buf newInput)
253 let _ = "choicesBranch.else"
254 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp buf end
255 in let _ = "pushValue"
256 in let _ = "comment: satisfy ((GHC.Classes.==) 'a')"
257 in let _ = "checkHorizon.oldCheck: checkedHorizon=2"
258 in let _ = "checkToken"
262 #) = readNext buf initPos
263 in if (GHC.Classes.==) 'a' c
265 let _ = "lift2Value checkedHorizon=1"
266 in let _ = "comment: satisfy ((GHC.Classes.==) 'a')"
267 in let _ = "checkHorizon.oldCheck: checkedHorizon=1"
268 in let _ = "checkToken"
273 in if (GHC.Classes.==) 'a' c
275 let _ = "lift2Value checkedHorizon=0"
280 Data.Set.Internal.empty
281 ( let _ = "resume.genCode"
282 in (GHC.Types.:) 'a' ((GHC.Types.:) 'a' GHC.Types . [])
288 let _ = "checkToken.fail"
290 Data.Set.Internal.Bin
292 ( Symantic.Parser.Grammar.Combinators.SomeFailure
294 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
297 Data.Set.Internal.Tip
298 Data.Set.Internal.Tip
302 #) = case GHC.Classes.compare @GHC.Types.Int initPos cs of
311 failExp GHC.Base.<> Data.Set.Internal.empty
316 Data.Set.Internal.empty
318 in onException Symantic.Parser.Grammar.Combinators.ExceptionFailure cs farInp farExp buf GHC.Types.False
320 let _ = "checkToken.fail"
322 Data.Set.Internal.Bin
324 ( Symantic.Parser.Grammar.Combinators.SomeFailure
326 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
329 Data.Set.Internal.Tip
330 Data.Set.Internal.Tip
334 #) = case GHC.Classes.compare @GHC.Types.Int initPos initPos of
343 failExp GHC.Base.<> Data.Set.Internal.empty
348 Data.Set.Internal.empty
350 in onException Symantic.Parser.Grammar.Combinators.ExceptionFailure initPos farInp farExp buf GHC.Types.False
352 let _ = "checkHorizon.newCheck.fail"
355 Data.Set.Internal.Bin
357 ( Symantic.Parser.Grammar.Combinators.SomeFailure
359 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 2
362 Data.Set.Internal.Tip
363 Data.Set.Internal.Tip
367 #) = case GHC.Classes.compare @GHC.Types.Int initPos initPos of
376 failExp GHC.Base.<> Data.Set.Internal.empty
381 Data.Set.Internal.empty
383 in Symantic.Parser.Machine.Generate.unForallOnException finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure initPos farInp farExp buf GHC.Types.True
384 in if GHC.Types.False
387 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
388 ( Symantic.Parser.Machine.Generate.ResultPartial GHC.Base.$
390 if Symantic.Parser.Machine.Input.nullInput newInput
392 else partialCont (append buf newInput)
395 in partialCont initBuffer