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