]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G16.expected.txt
test: dump splices using TH.runQ instead of calling ghc
[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 in let finalRet = \_farInp _farExp v _inp -> Data.Either.Right v
31 in let finalRaise ::
32 forall b.
33 Symantic.Parser.Machine.Generate.Catcher
34 inp
35 b = \_failInp (!farInp) (!farExp) ->
36 Data.Either.Left
37 Symantic.Parser.Machine.Generate.ParsingErrorStandard
38 { Symantic.Parser.Machine.Generate.parsingErrorOffset = Symantic.Parser.Machine.Input.offset farInp,
39 Symantic.Parser.Machine.Generate.parsingErrorUnexpected =
40 if readMore farInp
41 then
42 GHC.Maybe.Just
43 ( let (#
44 c,
45 _
46 #) = readNext farInp
47 in c
48 )
49 else GHC.Maybe.Nothing,
50 Symantic.Parser.Machine.Generate.parsingErrorExpecting = Data.Set.Internal.fromList farExp
51 }
52 in let
53 in let join = \farInp farExp v (!inp) ->
54 let readFail = finalRaise
55 in if readMore inp
56 then
57 let !(#
58 c,
59 cs
60 #) = readNext inp
61 in if ('d' GHC.Classes.==) c
62 then
63 let _ = "resume"
64 in finalRet
65 farInp
66 farExp
67 ( let _ = "resume.genCode"
68 in GHC.Show.show v
69 )
70 cs
71 else
72 let _ = "checkToken.else"
73 in let (#
74 farInp,
75 farExp
76 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp inp of
77 GHC.Types.LT ->
78 (#
79 inp,
80 [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'd']
81 #)
82 GHC.Types.EQ ->
83 (#
84 farInp,
85 farExp GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'd']
86 #)
87 GHC.Types.GT ->
88 (#
89 farInp,
90 farExp
91 #)
92 in finalRaise inp farInp farExp
93 else
94 let _ = "checkHorizon.else"
95 in let (#
96 farInp,
97 farExp
98 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp inp of
99 GHC.Types.LT ->
100 (#
101 inp,
102 [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 1]
103 #)
104 GHC.Types.EQ ->
105 (#
106 farInp,
107 farExp GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 1]
108 #)
109 GHC.Types.GT ->
110 (#
111 farInp,
112 farExp
113 #)
114 in finalRaise inp farInp farExp
115 in let _ = "catchException lbl=fail"
116 in let catchHandler (!failInp) (!farInp) (!farExp) =
117 let _ = "catchException.ko lbl=fail"
118 in if ( \( Data.Text.Internal.Text
119 _
120 i
121 _
122 )
123 ( Data.Text.Internal.Text
124 _
125 j
126 _
127 ) -> i GHC.Classes.== j
128 )
129 init
130 failInp
131 then
132 let _ = "choicesBranch.then"
133 in let readFail = finalRaise
134 in if readMore (Symantic.Parser.Machine.Input.shiftRightText 1 failInp)
135 then
136 let !(#
137 c,
138 cs
139 #) = readNext failInp
140 in if ('c' GHC.Classes.==) c
141 then
142 let _ = "resume"
143 in join
144 farInp
145 farExp
146 ( let _ = "resume.genCode"
147 in 'c'
148 )
149 cs
150 else
151 let _ = "checkToken.else"
152 in let (#
153 farInp,
154 farExp
155 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
156 GHC.Types.LT ->
157 (#
158 failInp,
159 [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'c']
160 #)
161 GHC.Types.EQ ->
162 (#
163 farInp,
164 farExp GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'c']
165 #)
166 GHC.Types.GT ->
167 (#
168 farInp,
169 farExp
170 #)
171 in finalRaise failInp farInp farExp
172 else
173 let _ = "checkHorizon.else"
174 in let (#
175 farInp,
176 farExp
177 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
178 GHC.Types.LT ->
179 (#
180 failInp,
181 [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 2]
182 #)
183 GHC.Types.EQ ->
184 (#
185 farInp,
186 farExp GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 2]
187 #)
188 GHC.Types.GT ->
189 (#
190 farInp,
191 farExp
192 #)
193 in finalRaise failInp farInp farExp
194 else
195 let _ = "choicesBranch.else"
196 in let (#
197 farInp,
198 farExp
199 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
200 GHC.Types.LT ->
201 (#
202 failInp,
203 []
204 #)
205 GHC.Types.EQ ->
206 (#
207 farInp,
208 farExp GHC.Base.<> []
209 #)
210 GHC.Types.GT ->
211 (#
212 farInp,
213 farExp
214 #)
215 in finalRaise failInp farInp farExp
216 in let join = \farInp farExp v (!inp) ->
217 let _ = "resume"
218 in join
219 farInp
220 farExp
221 ( let _ = "resume.genCode"
222 in v
223 )
224 inp
225 in let _ = "catchException lbl=fail"
226 in let catchHandler (!failInp) (!farInp) (!farExp) =
227 let _ = "catchException.ko lbl=fail"
228 in if ( \( Data.Text.Internal.Text
229 _
230 i
231 _
232 )
233 ( Data.Text.Internal.Text
234 _
235 j
236 _
237 ) -> i GHC.Classes.== j
238 )
239 init
240 failInp
241 then
242 let _ = "choicesBranch.then"
243 in let readFail = catchHandler
244 in if readMore (Symantic.Parser.Machine.Input.shiftRightText 1 failInp)
245 then
246 let !(#
247 c,
248 cs
249 #) = readNext failInp
250 in if ('b' GHC.Classes.==) c
251 then
252 let _ = "resume"
253 in join
254 farInp
255 farExp
256 ( let _ = "resume.genCode"
257 in 'b'
258 )
259 cs
260 else
261 let _ = "checkToken.else"
262 in let (#
263 farInp,
264 farExp
265 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
266 GHC.Types.LT ->
267 (#
268 failInp,
269 [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'b']
270 #)
271 GHC.Types.EQ ->
272 (#
273 farInp,
274 farExp GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'b']
275 #)
276 GHC.Types.GT ->
277 (#
278 farInp,
279 farExp
280 #)
281 in readFail failInp farInp farExp
282 else
283 let _ = "checkHorizon.else"
284 in let (#
285 farInp,
286 farExp
287 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
288 GHC.Types.LT ->
289 (#
290 failInp,
291 [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 2]
292 #)
293 GHC.Types.EQ ->
294 (#
295 farInp,
296 farExp GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 2]
297 #)
298 GHC.Types.GT ->
299 (#
300 farInp,
301 farExp
302 #)
303 in readFail failInp farInp farExp
304 else
305 let _ = "choicesBranch.else"
306 in let (#
307 farInp,
308 farExp
309 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
310 GHC.Types.LT ->
311 (#
312 failInp,
313 []
314 #)
315 GHC.Types.EQ ->
316 (#
317 farInp,
318 farExp GHC.Base.<> []
319 #)
320 GHC.Types.GT ->
321 (#
322 farInp,
323 farExp
324 #)
325 in catchHandler failInp farInp farExp
326 in let readFail = catchHandler
327 in if readMore (Symantic.Parser.Machine.Input.shiftRightText 1 init)
328 then
329 let !(#
330 c,
331 cs
332 #) = readNext init
333 in if ('a' GHC.Classes.==) c
334 then
335 let _ = "resume"
336 in join init GHC.Types
337 . []
338 ( let _ = "resume.genCode"
339 in 'a'
340 )
341 cs
342 else
343 let _ = "checkToken.else"
344 in let (#
345 farInp,
346 farExp
347 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init init of
348 GHC.Types.LT ->
349 (#
350 init,
351 [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'a']
352 #)
353 GHC.Types.EQ ->
354 (#
355 init,
356 GHC.Types . [] GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'a']
357 #)
358 GHC.Types.GT ->
359 (#
360 init,
361 GHC.Types . []
362 #)
363 in readFail init farInp farExp
364 else
365 let _ = "checkHorizon.else"
366 in let (#
367 farInp,
368 farExp
369 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init init of
370 GHC.Types.LT ->
371 (#
372 init,
373 [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 2]
374 #)
375 GHC.Types.EQ ->
376 (#
377 init,
378 GHC.Types . [] GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 2]
379 #)
380 GHC.Types.GT ->
381 (#
382 init,
383 GHC.Types . []
384 #)
385 in readFail init farInp farExp