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