]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G7.expected.txt
machine: make failure be minReads=0
[haskell/symantic-parser.git] / test / Golden / Splice / G7.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 _ = "resume"
97 in finalRet_13
98 farInp_35
99 farExp_36
100 ( let _ = "resume.genCode"
101 in GHC.Show.show v_37
102 )
103 inp_38
104 in let _ = "catch ExceptionFailure"
105 in let catchHandler_39 (!_exn_40) (!failInp_41) (!farInp_42) (!farExp_43) =
106 let _ = "catch.ko ExceptionFailure"
107 in let _ = "pushInput"
108 in if ( \( Data.Text.Internal.Text
109 _
110 i_44
111 _
112 )
113 ( Data.Text.Internal.Text
114 _
115 j_45
116 _
117 ) -> i_44 GHC.Classes.== j_45
118 )
119 init_1
120 failInp_41
121 then
122 let _ = "choicesBranch.then"
123 in let _ = "catch ExceptionFailure"
124 in let catchHandler_46 (!_exn_47) (!failInp_48) (!farInp_49) (!farExp_50) =
125 let _ = "catch.ko ExceptionFailure"
126 in let _ = "loadInput"
127 in let _ = "checkHorizon.noCheck"
128 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp_41 farInp_49 farExp_50
129 in let _ = "pushValue"
130 in let _ = "comment: satisfy"
131 in let inp_51 = failInp_41
132 in let readFail_52 = catchHandler_46
133 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=2"
134 in if readMore_2 (Symantic.Parser.Machine.Input.shiftRightText 1 inp_51)
135 then
136 let _ = "checkToken"
137 in let !(#
138 c_53,
139 cs_54
140 #) = readNext_3 inp_51
141 in if (GHC.Classes.==) 'a' c_53
142 then
143 let _ = "comment: satisfy"
144 in let _ = "checkHorizon.oldCheck: checkedHorizon=2"
145 in let _ = "checkToken"
146 in let !(#
147 c_55,
148 cs_56
149 #) = readNext_3 cs_54
150 in if (GHC.Classes.==) 'b' c_55
151 then
152 let _ = "commit"
153 in let _ = "resume"
154 in join_34
155 farInp_42
156 farExp_43
157 ( let _ = "resume.genCode"
158 in (GHC.Types.:) 'a' ((GHC.Types.:) 'b' GHC.Types . [])
159 )
160 cs_56
161 else
162 let _ = "checkToken.fail"
163 in let failExp_57 =
164 Data.Set.Internal.Bin
165 1
166 ( Symantic.Parser.Grammar.Combinators.SomeFailure
167 ( case inputToken of
168 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'b'
169 )
170 )
171 Data.Set.Internal.Tip
172 Data.Set.Internal.Tip
173 in let (#
174 farInp_58,
175 farExp_59
176 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_42 cs_54 of
177 GHC.Types.LT ->
178 (#
179 cs_54,
180 failExp_57
181 #)
182 GHC.Types.EQ ->
183 (#
184 farInp_42,
185 failExp_57 GHC.Base.<> farExp_43
186 #)
187 GHC.Types.GT ->
188 (#
189 farInp_42,
190 farExp_43
191 #)
192 in readFail_52 Symantic.Parser.Grammar.Combinators.ExceptionFailure cs_54 farInp_58 farExp_59
193 else
194 let _ = "checkToken.fail"
195 in let failExp_60 =
196 Data.Set.Internal.Bin
197 1
198 ( Symantic.Parser.Grammar.Combinators.SomeFailure
199 ( case inputToken of
200 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
201 )
202 )
203 Data.Set.Internal.Tip
204 Data.Set.Internal.Tip
205 in let (#
206 farInp_61,
207 farExp_62
208 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_42 inp_51 of
209 GHC.Types.LT ->
210 (#
211 inp_51,
212 failExp_60
213 #)
214 GHC.Types.EQ ->
215 (#
216 farInp_42,
217 failExp_60 GHC.Base.<> farExp_43
218 #)
219 GHC.Types.GT ->
220 (#
221 farInp_42,
222 farExp_43
223 #)
224 in readFail_52 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_51 farInp_61 farExp_62
225 else
226 let _ = "checkHorizon.newCheck.fail"
227 in let failExp_63 =
228 Data.Set.Internal.Bin
229 1
230 ( Symantic.Parser.Grammar.Combinators.SomeFailure
231 ( case inputToken of
232 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok'_6989586621679080671 2
233 )
234 )
235 Data.Set.Internal.Tip
236 Data.Set.Internal.Tip
237 in let (#
238 farInp_64,
239 farExp_65
240 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_42 inp_51 of
241 GHC.Types.LT ->
242 (#
243 inp_51,
244 failExp_63
245 #)
246 GHC.Types.EQ ->
247 (#
248 farInp_42,
249 failExp_63 GHC.Base.<> farExp_43
250 #)
251 GHC.Types.GT ->
252 (#
253 farInp_42,
254 farExp_43
255 #)
256 in readFail_52 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_51 farInp_64 farExp_65
257 else
258 let _ = "choicesBranch.else"
259 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp_41 farInp_42 farExp_43
260 in let _ = "catch ExceptionFailure"
261 in let catchHandler_66 (!_exn_67) (!failInp_68) (!farInp_69) (!farExp_70) =
262 let _ = "catch.ko ExceptionFailure"
263 in let _ = "loadInput"
264 in let _ = "checkHorizon.noCheck"
265 in catchHandler_39 Symantic.Parser.Grammar.Combinators.ExceptionFailure init_1 farInp_69 farExp_70
266 in let _ = "pushValue"
267 in let _ = "comment: satisfy"
268 in let inp_71 = init_1
269 in let readFail_72 = catchHandler_66
270 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=2"
271 in if readMore_2 (Symantic.Parser.Machine.Input.shiftRightText 1 inp_71)
272 then
273 let _ = "checkToken"
274 in let !(#
275 c_73,
276 cs_74
277 #) = readNext_3 inp_71
278 in if (GHC.Classes.==) 'a' c_73
279 then
280 let _ = "comment: satisfy"
281 in let _ = "checkHorizon.oldCheck: checkedHorizon=2"
282 in let _ = "checkToken"
283 in let !(#
284 c_75,
285 cs_76
286 #) = readNext_3 cs_74
287 in if (GHC.Classes.==) 'a' c_75
288 then
289 let _ = "commit"
290 in let _ = "commit"
291 in let _ = "resume"
292 in join_34
293 init_1
294 Data.Set.Internal.empty
295 ( let _ = "resume.genCode"
296 in (GHC.Types.:) 'a' ((GHC.Types.:) 'a' GHC.Types . [])
297 )
298 cs_76
299 else
300 let _ = "checkToken.fail"
301 in let failExp_77 =
302 Data.Set.Internal.Bin
303 1
304 ( Symantic.Parser.Grammar.Combinators.SomeFailure
305 ( case inputToken of
306 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
307 )
308 )
309 Data.Set.Internal.Tip
310 Data.Set.Internal.Tip
311 in let (#
312 farInp_78,
313 farExp_79
314 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 cs_74 of
315 GHC.Types.LT ->
316 (#
317 cs_74,
318 failExp_77
319 #)
320 GHC.Types.EQ ->
321 (#
322 init_1,
323 failExp_77 GHC.Base.<> Data.Set.Internal.empty
324 #)
325 GHC.Types.GT ->
326 (#
327 init_1,
328 Data.Set.Internal.empty
329 #)
330 in readFail_72 Symantic.Parser.Grammar.Combinators.ExceptionFailure cs_74 farInp_78 farExp_79
331 else
332 let _ = "checkToken.fail"
333 in let failExp_80 =
334 Data.Set.Internal.Bin
335 1
336 ( Symantic.Parser.Grammar.Combinators.SomeFailure
337 ( case inputToken of
338 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
339 )
340 )
341 Data.Set.Internal.Tip
342 Data.Set.Internal.Tip
343 in let (#
344 farInp_81,
345 farExp_82
346 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 inp_71 of
347 GHC.Types.LT ->
348 (#
349 inp_71,
350 failExp_80
351 #)
352 GHC.Types.EQ ->
353 (#
354 init_1,
355 failExp_80 GHC.Base.<> Data.Set.Internal.empty
356 #)
357 GHC.Types.GT ->
358 (#
359 init_1,
360 Data.Set.Internal.empty
361 #)
362 in readFail_72 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_71 farInp_81 farExp_82
363 else
364 let _ = "checkHorizon.newCheck.fail"
365 in let failExp_83 =
366 Data.Set.Internal.Bin
367 1
368 ( Symantic.Parser.Grammar.Combinators.SomeFailure
369 ( case inputToken of
370 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok'_6989586621679080671 2
371 )
372 )
373 Data.Set.Internal.Tip
374 Data.Set.Internal.Tip
375 in let (#
376 farInp_84,
377 farExp_85
378 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 inp_71 of
379 GHC.Types.LT ->
380 (#
381 inp_71,
382 failExp_83
383 #)
384 GHC.Types.EQ ->
385 (#
386 init_1,
387 failExp_83 GHC.Base.<> Data.Set.Internal.empty
388 #)
389 GHC.Types.GT ->
390 (#
391 init_1,
392 Data.Set.Internal.empty
393 #)
394 in readFail_72 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_71 farInp_84 farExp_85
395 )