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