]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G4.expected.txt
test: dump splices using TH.runQ instead of calling ghc
[haskell/symantic-parser.git] / test / Golden / Splice / G4.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 name
102 ( let _ = "suspend"
103 in \farInp farExp v (!inp) ->
104 name
105 ( let _ = "suspend"
106 in \farInp farExp v (!inp) ->
107 let _ = "resume"
108 in ok
109 farInp
110 farExp
111 ( let _ = "resume.genCode"
112 in \x -> v GHC.Types.: v x
113 )
114 inp
115 )
116 inp
117 Data.Map.Internal.Tip
118 )
119 inp
120 Data.Map.Internal.Tip
121 name = \(!ok) (!inp) (!koByLabel) ->
122 let _ = "catchException lbl=fail"
123 in let catchHandler (!failInp) (!farInp) (!farExp) =
124 let _ = "catchException.ko lbl=fail"
125 in let (#
126 farInp,
127 farExp
128 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp inp of
129 GHC.Types.LT ->
130 (#
131 inp,
132 []
133 #)
134 GHC.Types.EQ ->
135 (#
136 farInp,
137 farExp GHC.Base.<> []
138 #)
139 GHC.Types.GT ->
140 (#
141 farInp,
142 farExp
143 #)
144 in finalRaise inp farInp farExp
145 in let readFail = catchHandler
146 in if readMore (Symantic.Parser.Machine.Input.shiftRightText 3 inp)
147 then
148 let !(#
149 c,
150 cs
151 #) = readNext inp
152 in if ('a' GHC.Classes.==) c
153 then
154 let readFail = readFail
155 in let !(#
156 c,
157 cs
158 #) = readNext cs
159 in if ('b' GHC.Classes.==) c
160 then
161 let readFail = readFail
162 in let !(#
163 c,
164 cs
165 #) = readNext cs
166 in if ('c' GHC.Classes.==) c
167 then
168 let readFail = readFail
169 in let !(#
170 c,
171 cs
172 #) = readNext cs
173 in if ('d' GHC.Classes.==) c
174 then
175 let _ = "resume"
176 in ok init GHC.Types
177 . []
178 ( let _ = "resume.genCode"
179 in 'a' GHC.Types.: ('b' GHC.Types.: ('c' GHC.Types.: ('d' GHC.Types.: GHC.Types . [])))
180 )
181 cs
182 else
183 let _ = "checkToken.else"
184 in let (#
185 farInp,
186 farExp
187 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init cs of
188 GHC.Types.LT ->
189 (#
190 cs,
191 [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'd']
192 #)
193 GHC.Types.EQ ->
194 (#
195 init,
196 GHC.Types . [] GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'd']
197 #)
198 GHC.Types.GT ->
199 (#
200 init,
201 GHC.Types . []
202 #)
203 in readFail cs farInp farExp
204 else
205 let _ = "checkToken.else"
206 in let (#
207 farInp,
208 farExp
209 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init cs of
210 GHC.Types.LT ->
211 (#
212 cs,
213 [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'c']
214 #)
215 GHC.Types.EQ ->
216 (#
217 init,
218 GHC.Types . [] GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'c']
219 #)
220 GHC.Types.GT ->
221 (#
222 init,
223 GHC.Types . []
224 #)
225 in readFail cs farInp farExp
226 else
227 let _ = "checkToken.else"
228 in let (#
229 farInp,
230 farExp
231 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init cs of
232 GHC.Types.LT ->
233 (#
234 cs,
235 [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'b']
236 #)
237 GHC.Types.EQ ->
238 (#
239 init,
240 GHC.Types . [] GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'b']
241 #)
242 GHC.Types.GT ->
243 (#
244 init,
245 GHC.Types . []
246 #)
247 in readFail cs farInp farExp
248 else
249 let _ = "checkToken.else"
250 in let (#
251 farInp,
252 farExp
253 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init inp of
254 GHC.Types.LT ->
255 (#
256 inp,
257 [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'a']
258 #)
259 GHC.Types.EQ ->
260 (#
261 init,
262 GHC.Types . [] GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'a']
263 #)
264 GHC.Types.GT ->
265 (#
266 init,
267 GHC.Types . []
268 #)
269 in readFail inp farInp farExp
270 else
271 let _ = "checkHorizon.else"
272 in let (#
273 farInp,
274 farExp
275 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init inp of
276 GHC.Types.LT ->
277 (#
278 inp,
279 [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 4]
280 #)
281 GHC.Types.EQ ->
282 (#
283 init,
284 GHC.Types . [] GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 4]
285 #)
286 GHC.Types.GT ->
287 (#
288 init,
289 GHC.Types . []
290 #)
291 in readFail inp farInp farExp
292 in name
293 ( let _ = "suspend"
294 in \farInp farExp v (!inp) ->
295 name
296 ( let _ = "suspend"
297 in \farInp farExp v (!inp) ->
298 let _ = "resume"
299 in finalRet
300 farInp
301 farExp
302 ( let _ = "resume.genCode"
303 in GHC.Show.show (v GHC.Types.: v GHC.Types . [])
304 )
305 inp
306 )
307 inp
308 Data.Map.Internal.Tip
309 )
310 init
311 Data.Map.Internal.Tip