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