]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G16.expected.txt
add registers
[haskell/symantic-parser.git] / test / Golden / Splice / G16.expected.txt
1 \(input :: inp) ->
2 let !(#
3 init,
4 readMore,
5 readNext
6 #) =
7 let _ = "cursorOf"
8 in let next
9 ( t@( Data.Text.Internal.Text
10 arr
11 off
12 unconsumed
13 )
14 ) =
15 let !( Data.Text.Unsafe.Iter
16 c
17 d
18 ) = Data.Text.Unsafe.iter t 0
19 in (#
20 c,
21 Data.Text.Internal.Text arr (off GHC.Num.+ d) (unconsumed GHC.Num.- d)
22 #)
23 more
24 ( Data.Text.Internal.Text
25 _
26 _
27 unconsumed
28 ) = unconsumed GHC.Classes.> 0
29 in (# input, more, next #)
30 finalRet = \_farInp _farExp v _inp -> Symantic.Parser.Machine.Generate.returnST GHC.Base.$ Data.Either.Right v
31 finalRaise ::
32 forall st b.
33 Symantic.Parser.Machine.Generate.Catcher
34 st
35 inp
36 b = \(!exn) _failInp (!farInp) (!farExp) ->
37 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
38 Data.Either.Left
39 Symantic.Parser.Machine.Generate.ParsingError
40 { Symantic.Parser.Machine.Generate.parsingErrorOffset = Symantic.Parser.Machine.Input.offset farInp,
41 Symantic.Parser.Machine.Generate.parsingErrorException = exn,
42 Symantic.Parser.Machine.Generate.parsingErrorUnexpected =
43 if readMore farInp
44 then
45 GHC.Maybe.Just
46 ( let (#
47 c,
48 _
49 #) = readNext farInp
50 in c
51 )
52 else GHC.Maybe.Nothing,
53 Symantic.Parser.Machine.Generate.parsingErrorExpecting = farExp
54 }
55 in GHC.ST.runST
56 ( let inputToken = Data.Proxy.Proxy :: Data.Proxy.Proxy (Symantic.Parser.Machine.Input.InputToken inp)
57 in let
58 in let join = \farInp farExp v (!inp) ->
59 let readFail = finalRaise
60 in if readMore inp
61 then
62 let !(#
63 c,
64 cs
65 #) = readNext inp
66 in if (GHC.Classes.==) 'd' c
67 then
68 let _ = "resume"
69 in finalRet
70 farInp
71 farExp
72 ( let _ = "resume.genCode"
73 in GHC.Show.show v
74 )
75 cs
76 else
77 let _ = "checkToken.else"
78 in let failExp =
79 Data.Set.Internal.Bin
80 1
81 ( Symantic.Parser.Grammar.Combinators.SomeFailure
82 ( case inputToken of
83 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'd'
84 )
85 )
86 Data.Set.Internal.Tip
87 Data.Set.Internal.Tip
88 in let (#
89 farInp,
90 farExp
91 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp inp of
92 GHC.Types.LT ->
93 (#
94 inp,
95 failExp
96 #)
97 GHC.Types.EQ ->
98 (#
99 farInp,
100 failExp GHC.Base.<> farExp
101 #)
102 GHC.Types.GT ->
103 (#
104 farInp,
105 farExp
106 #)
107 in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure inp farInp farExp
108 else
109 let _ = "checkHorizon.else"
110 in let failExp =
111 Data.Set.Internal.Bin
112 1
113 ( Symantic.Parser.Grammar.Combinators.SomeFailure
114 ( case inputToken of
115 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
116 )
117 )
118 Data.Set.Internal.Tip
119 Data.Set.Internal.Tip
120 in let (#
121 farInp,
122 farExp
123 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp inp of
124 GHC.Types.LT ->
125 (#
126 inp,
127 failExp
128 #)
129 GHC.Types.EQ ->
130 (#
131 farInp,
132 failExp GHC.Base.<> farExp
133 #)
134 GHC.Types.GT ->
135 (#
136 farInp,
137 farExp
138 #)
139 in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure inp farInp farExp
140 in let _ = "catch ExceptionFailure"
141 in let catchHandler (!_exn) (!failInp) (!farInp) (!farExp) =
142 let _ = "catch.ko ExceptionFailure"
143 in if ( \( Data.Text.Internal.Text
144 _
145 i
146 _
147 )
148 ( Data.Text.Internal.Text
149 _
150 j
151 _
152 ) -> i GHC.Classes.== j
153 )
154 init
155 failInp
156 then
157 let _ = "choicesBranch.then"
158 in let _ = "catch ExceptionFailure"
159 in let catchHandler (!_exn) (!failInp) (!farInp) (!farExp) =
160 let _ = "catch.ko ExceptionFailure"
161 in if ( \( Data.Text.Internal.Text
162 _
163 i
164 _
165 )
166 ( Data.Text.Internal.Text
167 _
168 j
169 _
170 ) -> i GHC.Classes.== j
171 )
172 failInp
173 failInp
174 then
175 let _ = "choicesBranch.then"
176 in let readFail = finalRaise
177 in if readMore (Symantic.Parser.Machine.Input.shiftRightText 1 failInp)
178 then
179 let !(#
180 c,
181 cs
182 #) = readNext failInp
183 in if (GHC.Classes.==) 'c' c
184 then
185 let _ = "resume"
186 in join
187 farInp
188 farExp
189 ( let _ = "resume.genCode"
190 in 'c'
191 )
192 cs
193 else
194 let _ = "checkToken.else"
195 in let failExp =
196 Data.Set.Internal.Bin
197 1
198 ( Symantic.Parser.Grammar.Combinators.SomeFailure
199 ( case inputToken of
200 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'c'
201 )
202 )
203 Data.Set.Internal.Tip
204 Data.Set.Internal.Tip
205 in let (#
206 farInp,
207 farExp
208 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
209 GHC.Types.LT ->
210 (#
211 failInp,
212 failExp
213 #)
214 GHC.Types.EQ ->
215 (#
216 farInp,
217 failExp GHC.Base.<> farExp
218 #)
219 GHC.Types.GT ->
220 (#
221 farInp,
222 farExp
223 #)
224 in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp
225 else
226 let _ = "checkHorizon.else"
227 in let failExp =
228 Data.Set.Internal.Bin
229 1
230 ( Symantic.Parser.Grammar.Combinators.SomeFailure
231 ( case inputToken of
232 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 2
233 )
234 )
235 Data.Set.Internal.Tip
236 Data.Set.Internal.Tip
237 in let (#
238 farInp,
239 farExp
240 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
241 GHC.Types.LT ->
242 (#
243 failInp,
244 failExp
245 #)
246 GHC.Types.EQ ->
247 (#
248 farInp,
249 failExp GHC.Base.<> farExp
250 #)
251 GHC.Types.GT ->
252 (#
253 farInp,
254 farExp
255 #)
256 in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp
257 else
258 let _ = "choicesBranch.else"
259 in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp
260 in let readFail = catchHandler
261 in if readMore (Symantic.Parser.Machine.Input.shiftRightText 1 failInp)
262 then
263 let !(#
264 c,
265 cs
266 #) = readNext failInp
267 in if (GHC.Classes.==) 'b' c
268 then
269 let _ = "resume"
270 in join
271 farInp
272 farExp
273 ( let _ = "resume.genCode"
274 in 'b'
275 )
276 cs
277 else
278 let _ = "checkToken.else"
279 in let failExp =
280 Data.Set.Internal.Bin
281 1
282 ( Symantic.Parser.Grammar.Combinators.SomeFailure
283 ( case inputToken of
284 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'b'
285 )
286 )
287 Data.Set.Internal.Tip
288 Data.Set.Internal.Tip
289 in let (#
290 farInp,
291 farExp
292 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
293 GHC.Types.LT ->
294 (#
295 failInp,
296 failExp
297 #)
298 GHC.Types.EQ ->
299 (#
300 farInp,
301 failExp GHC.Base.<> farExp
302 #)
303 GHC.Types.GT ->
304 (#
305 farInp,
306 farExp
307 #)
308 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp
309 else
310 let _ = "checkHorizon.else"
311 in let failExp =
312 Data.Set.Internal.Bin
313 1
314 ( Symantic.Parser.Grammar.Combinators.SomeFailure
315 ( case inputToken of
316 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 2
317 )
318 )
319 Data.Set.Internal.Tip
320 Data.Set.Internal.Tip
321 in let (#
322 farInp,
323 farExp
324 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
325 GHC.Types.LT ->
326 (#
327 failInp,
328 failExp
329 #)
330 GHC.Types.EQ ->
331 (#
332 farInp,
333 failExp GHC.Base.<> farExp
334 #)
335 GHC.Types.GT ->
336 (#
337 farInp,
338 farExp
339 #)
340 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp
341 else
342 let _ = "choicesBranch.else"
343 in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp
344 in let readFail = catchHandler
345 in if readMore (Symantic.Parser.Machine.Input.shiftRightText 1 init)
346 then
347 let !(# c, cs #) = readNext init
348 in if (GHC.Classes.==) 'a' c
349 then
350 let _ = "resume"
351 in join
352 init
353 Data.Set.Internal.empty
354 ( let _ = "resume.genCode"
355 in 'a'
356 )
357 cs
358 else
359 let _ = "checkToken.else"
360 in let failExp =
361 Data.Set.Internal.Bin
362 1
363 ( Symantic.Parser.Grammar.Combinators.SomeFailure
364 ( case inputToken of
365 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
366 )
367 )
368 Data.Set.Internal.Tip
369 Data.Set.Internal.Tip
370 in let (#
371 farInp,
372 farExp
373 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init init of
374 GHC.Types.LT ->
375 (#
376 init,
377 failExp
378 #)
379 GHC.Types.EQ ->
380 (#
381 init,
382 failExp GHC.Base.<> Data.Set.Internal.empty
383 #)
384 GHC.Types.GT ->
385 (#
386 init,
387 Data.Set.Internal.empty
388 #)
389 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure init farInp farExp
390 else
391 let _ = "checkHorizon.else"
392 in let failExp =
393 Data.Set.Internal.Bin
394 1
395 ( Symantic.Parser.Grammar.Combinators.SomeFailure
396 ( case inputToken of
397 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 2
398 )
399 )
400 Data.Set.Internal.Tip
401 Data.Set.Internal.Tip
402 in let (#
403 farInp,
404 farExp
405 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init init of
406 GHC.Types.LT ->
407 (#
408 init,
409 failExp
410 #)
411 GHC.Types.EQ ->
412 (#
413 init,
414 failExp GHC.Base.<> Data.Set.Internal.empty
415 #)
416 GHC.Types.GT ->
417 (#
418 init,
419 Data.Set.Internal.empty
420 #)
421 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure init farInp farExp
422 )