]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G15.expected.txt
machine: make failure be minReads=0
[haskell/symantic-parser.git] / test / Golden / Splice / G15.expected.txt
1 \(input_0 :: inp_6989586621679040759) ->
2 let !(#
3 init_1,
4 readMore_2,
5 readNext_3
6 #) =
7 let _ = "cursorOf"
8 in let next_4
9 ( t_5@( Data.Text.Internal.Text
10 arr_6
11 off_7
12 unconsumed_8
13 )
14 ) =
15 let !( Data.Text.Unsafe.Iter
16 c_9
17 d_10
18 ) = Data.Text.Unsafe.iter t_5 0
19 in (#
20 c_9,
21 Data.Text.Internal.Text arr_6 (off_7 GHC.Num.+ d_10) (unconsumed_8 GHC.Num.- d_10)
22 #)
23 more_11
24 ( Data.Text.Internal.Text
25 _
26 _
27 unconsumed_12
28 ) = unconsumed_12 GHC.Classes.> 0
29 in (#
30 input_0,
31 more_11,
32 next_4
33 #)
34 finalRet_13 = \_farInp_14 _farExp_15 v_16 _inp_17 -> Symantic.Parser.Machine.Generate.returnST GHC.Base.$ Data.Either.Right v_16
35 finalRaise_18 ::
36 forall st_19 b_20.
37 Symantic.Parser.Machine.Generate.Catcher
38 st_19
39 inp_6989586621679040759
40 b_20 = \(!exn_21) _failInp_22 (!farInp_23) (!farExp_24) ->
41 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
42 Data.Either.Left
43 Symantic.Parser.Machine.Generate.ParsingError
44 { Symantic.Parser.Machine.Generate.parsingErrorOffset = Symantic.Parser.Machine.Input.offset farInp_23,
45 Symantic.Parser.Machine.Generate.parsingErrorException = exn_21,
46 Symantic.Parser.Machine.Generate.parsingErrorUnexpected =
47 if readMore_2 farInp_23
48 then
49 GHC.Maybe.Just
50 ( let (#
51 c_25,
52 _
53 #) = readNext_3 farInp_23
54 in c_25
55 )
56 else GHC.Maybe.Nothing,
57 Symantic.Parser.Machine.Generate.parsingErrorExpecting =
58 let ( minHoriz_26,
59 res_27
60 ) =
61 Data.Set.Internal.foldr
62 ( \f_28
63 ( minH_29,
64 acc_30
65 ) -> case Symantic.Parser.Grammar.Combinators.unSomeFailure f_28 of
66 GHC.Maybe.Just (Symantic.Parser.Grammar.Combinators.FailureHorizon h_31 :: Symantic.Parser.Grammar.Combinators.Failure (Symantic.Parser.Grammar.Combinators.CombSatisfiable (Symantic.Parser.Machine.Input.InputToken inp_6989586621679040759)))
67 | GHC.Maybe.Just old_32 <- minH_29 ->
68 ( GHC.Maybe.Just (GHC.Classes.min old_32 h_31),
69 acc_30
70 )
71 | GHC.Base.otherwise ->
72 ( GHC.Maybe.Just h_31,
73 acc_30
74 )
75 _ ->
76 ( minH_29,
77 f_28 GHC.Types.: acc_30
78 )
79 )
80 ( GHC.Maybe.Nothing,
81 GHC.Types . []
82 )
83 farExp_24
84 in Data.Set.Internal.fromList GHC.Base.$
85 ( case minHoriz_26 of
86 GHC.Maybe.Just h_33 -> Symantic.Parser.Grammar.Combinators.SomeFailure (Symantic.Parser.Grammar.Combinators.FailureHorizon @(Symantic.Parser.Machine.Input.InputToken inp_6989586621679040759) h_33) GHC.Types.: res_27
87 GHC.Maybe.Nothing -> res_27
88 )
89 }
90 in GHC.ST.runST
91 ( let inputToken = Data.Proxy.Proxy :: Data.Proxy.Proxy (Symantic.Parser.Machine.Input.InputToken inp_6989586621679040759)
92 in let _ = "checkHorizon.noCheck"
93 in let
94 in let _ = "pushValue"
95 in let join_34 = \farInp_35 farExp_36 v_37 (!inp_38) ->
96 let _ = "comment: satisfy"
97 in let inp_39 = inp_38
98 in let readFail_40 = finalRaise_18
99 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=1"
100 in if readMore_2 inp_39
101 then
102 let _ = "checkToken"
103 in let !(#
104 c_41,
105 cs_42
106 #) = readNext_3 inp_39
107 in if (GHC.Classes.==) 'c' c_41
108 then
109 let _ = "resume"
110 in finalRet_13
111 farInp_35
112 farExp_36
113 ( let _ = "resume.genCode"
114 in GHC.Show.show v_37
115 )
116 cs_42
117 else
118 let _ = "checkToken.fail"
119 in let failExp_43 =
120 Data.Set.Internal.Bin
121 1
122 ( Symantic.Parser.Grammar.Combinators.SomeFailure
123 ( case inputToken of
124 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'c'
125 )
126 )
127 Data.Set.Internal.Tip
128 Data.Set.Internal.Tip
129 in let (#
130 farInp_44,
131 farExp_45
132 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_35 inp_39 of
133 GHC.Types.LT ->
134 (#
135 inp_39,
136 failExp_43
137 #)
138 GHC.Types.EQ ->
139 (#
140 farInp_35,
141 failExp_43 GHC.Base.<> farExp_36
142 #)
143 GHC.Types.GT ->
144 (#
145 farInp_35,
146 farExp_36
147 #)
148 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_39 farInp_44 farExp_45
149 else
150 let _ = "checkHorizon.newCheck.fail"
151 in let failExp_46 =
152 Data.Set.Internal.Bin
153 1
154 ( Symantic.Parser.Grammar.Combinators.SomeFailure
155 ( case inputToken of
156 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok'_6989586621679080671 1
157 )
158 )
159 Data.Set.Internal.Tip
160 Data.Set.Internal.Tip
161 in let (#
162 farInp_47,
163 farExp_48
164 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_35 inp_39 of
165 GHC.Types.LT ->
166 (#
167 inp_39,
168 failExp_46
169 #)
170 GHC.Types.EQ ->
171 (#
172 farInp_35,
173 failExp_46 GHC.Base.<> farExp_36
174 #)
175 GHC.Types.GT ->
176 (#
177 farInp_35,
178 farExp_36
179 #)
180 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_39 farInp_47 farExp_48
181 in let _ = "catch ExceptionFailure"
182 in let catchHandler_49 (!_exn_50) (!failInp_51) (!farInp_52) (!farExp_53) =
183 let _ = "catch.ko ExceptionFailure"
184 in let _ = "pushInput"
185 in if ( \( Data.Text.Internal.Text
186 _
187 i_54
188 _
189 )
190 ( Data.Text.Internal.Text
191 _
192 j_55
193 _
194 ) -> i_54 GHC.Classes.== j_55
195 )
196 init_1
197 failInp_51
198 then
199 let _ = "choicesBranch.then"
200 in let _ = "pushValue"
201 in let _ = "comment: satisfy"
202 in let inp_56 = failInp_51
203 in let readFail_57 = finalRaise_18
204 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=2"
205 in if readMore_2 (Symantic.Parser.Machine.Input.shiftRightText 1 inp_56)
206 then
207 let _ = "checkToken"
208 in let !(#
209 c_58,
210 cs_59
211 #) = readNext_3 inp_56
212 in if (GHC.Classes.==) 'b' c_58
213 then
214 let _ = "resume"
215 in join_34
216 farInp_52
217 farExp_53
218 ( let _ = "resume.genCode"
219 in 'b'
220 )
221 cs_59
222 else
223 let _ = "checkToken.fail"
224 in let failExp_60 =
225 Data.Set.Internal.Bin
226 1
227 ( Symantic.Parser.Grammar.Combinators.SomeFailure
228 ( case inputToken of
229 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'b'
230 )
231 )
232 Data.Set.Internal.Tip
233 Data.Set.Internal.Tip
234 in let (#
235 farInp_61,
236 farExp_62
237 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_52 inp_56 of
238 GHC.Types.LT ->
239 (#
240 inp_56,
241 failExp_60
242 #)
243 GHC.Types.EQ ->
244 (#
245 farInp_52,
246 failExp_60 GHC.Base.<> farExp_53
247 #)
248 GHC.Types.GT ->
249 (#
250 farInp_52,
251 farExp_53
252 #)
253 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_56 farInp_61 farExp_62
254 else
255 let _ = "checkHorizon.newCheck.fail"
256 in let failExp_63 =
257 Data.Set.Internal.Bin
258 1
259 ( Symantic.Parser.Grammar.Combinators.SomeFailure
260 ( case inputToken of
261 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok'_6989586621679080671 2
262 )
263 )
264 Data.Set.Internal.Tip
265 Data.Set.Internal.Tip
266 in let (#
267 farInp_64,
268 farExp_65
269 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_52 inp_56 of
270 GHC.Types.LT ->
271 (#
272 inp_56,
273 failExp_63
274 #)
275 GHC.Types.EQ ->
276 (#
277 farInp_52,
278 failExp_63 GHC.Base.<> farExp_53
279 #)
280 GHC.Types.GT ->
281 (#
282 farInp_52,
283 farExp_53
284 #)
285 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_56 farInp_64 farExp_65
286 else
287 let _ = "choicesBranch.else"
288 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp_51 farInp_52 farExp_53
289 in let _ = "pushValue"
290 in let _ = "comment: satisfy"
291 in let inp_66 = init_1
292 in let readFail_67 = catchHandler_49
293 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=2"
294 in if readMore_2 (Symantic.Parser.Machine.Input.shiftRightText 1 inp_66)
295 then
296 let _ = "checkToken"
297 in let !(#
298 c_68,
299 cs_69
300 #) = readNext_3 inp_66
301 in if (GHC.Classes.==) 'a' c_68
302 then
303 let _ = "commit"
304 in let _ = "resume"
305 in join_34
306 init_1
307 Data.Set.Internal.empty
308 ( let _ = "resume.genCode"
309 in 'a'
310 )
311 cs_69
312 else
313 let _ = "checkToken.fail"
314 in let failExp_70 =
315 Data.Set.Internal.Bin
316 1
317 ( Symantic.Parser.Grammar.Combinators.SomeFailure
318 ( case inputToken of
319 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
320 )
321 )
322 Data.Set.Internal.Tip
323 Data.Set.Internal.Tip
324 in let (#
325 farInp_71,
326 farExp_72
327 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 inp_66 of
328 GHC.Types.LT ->
329 (#
330 inp_66,
331 failExp_70
332 #)
333 GHC.Types.EQ ->
334 (#
335 init_1,
336 failExp_70 GHC.Base.<> Data.Set.Internal.empty
337 #)
338 GHC.Types.GT ->
339 (#
340 init_1,
341 Data.Set.Internal.empty
342 #)
343 in readFail_67 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_66 farInp_71 farExp_72
344 else
345 let _ = "checkHorizon.newCheck.fail"
346 in let failExp_73 =
347 Data.Set.Internal.Bin
348 1
349 ( Symantic.Parser.Grammar.Combinators.SomeFailure
350 ( case inputToken of
351 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok'_6989586621679080671 2
352 )
353 )
354 Data.Set.Internal.Tip
355 Data.Set.Internal.Tip
356 in let (#
357 farInp_74,
358 farExp_75
359 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 inp_66 of
360 GHC.Types.LT ->
361 (#
362 inp_66,
363 failExp_73
364 #)
365 GHC.Types.EQ ->
366 (#
367 init_1,
368 failExp_73 GHC.Base.<> Data.Set.Internal.empty
369 #)
370 GHC.Types.GT ->
371 (#
372 init_1,
373 Data.Set.Internal.empty
374 #)
375 in readFail_67 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_66 farInp_74 farExp_75
376 )