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