]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G12.expected.txt
test: dump splices using TH.runQ instead of calling ghc
[haskell/symantic-parser.git] / test / Golden / Splice / G12.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 name = \(!ok) (!inp) (!koByLabel) ->
53 let _ = "catchException lbl=fail"
54 in let catchHandler (!failInp) (!farInp) (!farExp) =
55 let _ = "catchException.ko lbl=fail"
56 in if ( \( Data.Text.Internal.Text
57 _
58 i
59 _
60 )
61 ( Data.Text.Internal.Text
62 _
63 j
64 _
65 ) -> i GHC.Classes.== j
66 )
67 inp
68 failInp
69 then
70 let _ = "choicesBranch.then"
71 in let _ = "resume"
72 in ok
73 farInp
74 farExp
75 ( let _ = "resume.genCode"
76 in \x -> x
77 )
78 failInp
79 else
80 let _ = "choicesBranch.else"
81 in let (#
82 farInp,
83 farExp
84 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
85 GHC.Types.LT ->
86 (#
87 failInp,
88 []
89 #)
90 GHC.Types.EQ ->
91 (#
92 farInp,
93 farExp GHC.Base.<> []
94 #)
95 GHC.Types.GT ->
96 (#
97 farInp,
98 farExp
99 #)
100 in finalRaise failInp farInp farExp
101 in let readFail = catchHandler
102 in if readMore inp
103 then
104 let !(#
105 c,
106 cs
107 #) = readNext inp
108 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
109 then
110 name
111 ( let _ = "suspend"
112 in \farInp farExp v (!inp) ->
113 let _ = "resume"
114 in ok
115 farInp
116 farExp
117 ( let _ = "resume.genCode"
118 in \x -> c GHC.Types.: v x
119 )
120 inp
121 )
122 cs
123 Data.Map.Internal.Tip
124 else
125 let _ = "checkToken.else"
126 in let (#
127 farInp,
128 farExp
129 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init inp of
130 GHC.Types.LT ->
131 (#
132 inp,
133 [Symantic.Parser.Grammar.Combinators.ErrorItemLabel "oneOf"]
134 #)
135 GHC.Types.EQ ->
136 (#
137 init,
138 GHC.Types . [] GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemLabel "oneOf"]
139 #)
140 GHC.Types.GT ->
141 (#
142 init,
143 GHC.Types . []
144 #)
145 in readFail inp farInp farExp
146 else
147 let _ = "checkHorizon.else"
148 in let (#
149 farInp,
150 farExp
151 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init inp of
152 GHC.Types.LT ->
153 (#
154 inp,
155 [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 1]
156 #)
157 GHC.Types.EQ ->
158 (#
159 init,
160 GHC.Types . [] GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 1]
161 #)
162 GHC.Types.GT ->
163 (#
164 init,
165 GHC.Types . []
166 #)
167 in readFail inp farInp farExp
168 in name
169 ( let _ = "suspend"
170 in \farInp farExp v (!inp) ->
171 let join = \farInp farExp v (!inp) ->
172 let _ = "resume"
173 in finalRet
174 farInp
175 farExp
176 ( let _ = "resume.genCode"
177 in GHC.Show.show (v GHC.Types . [])
178 )
179 inp
180 in let _ = "catchException lbl=fail"
181 in let catchHandler (!failInp) (!farInp) (!farExp) =
182 let _ = "catchException.ko lbl=fail"
183 in if ( \( Data.Text.Internal.Text
184 _
185 i
186 _
187 )
188 ( Data.Text.Internal.Text
189 _
190 j
191 _
192 ) -> i GHC.Classes.== j
193 )
194 inp
195 failInp
196 then
197 let _ = "choicesBranch.then"
198 in let (#
199 farInp,
200 farExp
201 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
202 GHC.Types.LT ->
203 (#
204 failInp,
205 [Symantic.Parser.Grammar.Combinators.ErrorItemEnd]
206 #)
207 GHC.Types.EQ ->
208 (#
209 farInp,
210 farExp GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemEnd]
211 #)
212 GHC.Types.GT ->
213 (#
214 farInp,
215 farExp
216 #)
217 in finalRaise failInp farInp farExp
218 else
219 let _ = "choicesBranch.else"
220 in let (#
221 farInp,
222 farExp
223 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
224 GHC.Types.LT ->
225 (#
226 failInp,
227 []
228 #)
229 GHC.Types.EQ ->
230 (#
231 farInp,
232 farExp GHC.Base.<> []
233 #)
234 GHC.Types.GT ->
235 (#
236 farInp,
237 farExp
238 #)
239 in finalRaise failInp farInp farExp
240 in let _ = "catchException lbl=fail"
241 in let catchHandler (!failInp) (!farInp) (!farExp) =
242 let _ = "catchException.ko lbl=fail"
243 in let _ = "resume"
244 in join
245 farInp
246 farExp
247 ( let _ = "resume.genCode"
248 in GHC.Tuple . ()
249 )
250 inp
251 in let readFail = catchHandler
252 in if readMore inp
253 then
254 let !(#
255 c,
256 cs
257 #) = readNext inp
258 in if (\x -> GHC.Types.True) c
259 then
260 let (#
261 farInp,
262 farExp
263 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp inp of
264 GHC.Types.LT ->
265 (#
266 inp,
267 []
268 #)
269 GHC.Types.EQ ->
270 (#
271 farInp,
272 farExp GHC.Base.<> []
273 #)
274 GHC.Types.GT ->
275 (#
276 farInp,
277 farExp
278 #)
279 in catchHandler inp farInp farExp
280 else
281 let _ = "checkToken.else"
282 in let (#
283 farInp,
284 farExp
285 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp inp of
286 GHC.Types.LT ->
287 (#
288 inp,
289 []
290 #)
291 GHC.Types.EQ ->
292 (#
293 farInp,
294 farExp GHC.Base.<> []
295 #)
296 GHC.Types.GT ->
297 (#
298 farInp,
299 farExp
300 #)
301 in readFail inp farInp farExp
302 else
303 let _ = "checkHorizon.else"
304 in let (#
305 farInp,
306 farExp
307 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp inp of
308 GHC.Types.LT ->
309 (#
310 inp,
311 [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 1]
312 #)
313 GHC.Types.EQ ->
314 (#
315 farInp,
316 farExp GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 1]
317 #)
318 GHC.Types.GT ->
319 (#
320 farInp,
321 farExp
322 #)
323 in readFail inp farInp farExp
324 )
325 init
326 Data.Map.Internal.Tip