]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G6.expected.txt
machine: make failure be minReads=0
[haskell/symantic-parser.git] / test / Golden / Splice / G6.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 _ = "pushValue"
124 in let _ = "comment: satisfy"
125 in let inp_46 = failInp_41
126 in let readFail_47 = finalRaise_18
127 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=2"
128 in if readMore_2 (Symantic.Parser.Machine.Input.shiftRightText 1 inp_46)
129 then
130 let _ = "checkToken"
131 in let !(#
132 c_48,
133 cs_49
134 #) = readNext_3 inp_46
135 in if (GHC.Classes.==) 'a' c_48
136 then
137 let _ = "comment: satisfy"
138 in let _ = "checkHorizon.oldCheck: checkedHorizon=2"
139 in let _ = "checkToken"
140 in let !(#
141 c_50,
142 cs_51
143 #) = readNext_3 cs_49
144 in if (GHC.Classes.==) 'b' c_50
145 then
146 let _ = "resume"
147 in join_34
148 farInp_42
149 farExp_43
150 ( let _ = "resume.genCode"
151 in (GHC.Types.:) 'a' ((GHC.Types.:) 'b' GHC.Types . [])
152 )
153 cs_51
154 else
155 let _ = "checkToken.fail"
156 in let failExp_52 =
157 Data.Set.Internal.Bin
158 1
159 ( Symantic.Parser.Grammar.Combinators.SomeFailure
160 ( case inputToken of
161 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'b'
162 )
163 )
164 Data.Set.Internal.Tip
165 Data.Set.Internal.Tip
166 in let (#
167 farInp_53,
168 farExp_54
169 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_42 cs_49 of
170 GHC.Types.LT ->
171 (#
172 cs_49,
173 failExp_52
174 #)
175 GHC.Types.EQ ->
176 (#
177 farInp_42,
178 failExp_52 GHC.Base.<> farExp_43
179 #)
180 GHC.Types.GT ->
181 (#
182 farInp_42,
183 farExp_43
184 #)
185 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure cs_49 farInp_53 farExp_54
186 else
187 let _ = "checkToken.fail"
188 in let failExp_55 =
189 Data.Set.Internal.Bin
190 1
191 ( Symantic.Parser.Grammar.Combinators.SomeFailure
192 ( case inputToken of
193 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
194 )
195 )
196 Data.Set.Internal.Tip
197 Data.Set.Internal.Tip
198 in let (#
199 farInp_56,
200 farExp_57
201 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_42 inp_46 of
202 GHC.Types.LT ->
203 (#
204 inp_46,
205 failExp_55
206 #)
207 GHC.Types.EQ ->
208 (#
209 farInp_42,
210 failExp_55 GHC.Base.<> farExp_43
211 #)
212 GHC.Types.GT ->
213 (#
214 farInp_42,
215 farExp_43
216 #)
217 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_46 farInp_56 farExp_57
218 else
219 let _ = "checkHorizon.newCheck.fail"
220 in let failExp_58 =
221 Data.Set.Internal.Bin
222 1
223 ( Symantic.Parser.Grammar.Combinators.SomeFailure
224 ( case inputToken of
225 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok'_6989586621679080671 2
226 )
227 )
228 Data.Set.Internal.Tip
229 Data.Set.Internal.Tip
230 in let (#
231 farInp_59,
232 farExp_60
233 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_42 inp_46 of
234 GHC.Types.LT ->
235 (#
236 inp_46,
237 failExp_58
238 #)
239 GHC.Types.EQ ->
240 (#
241 farInp_42,
242 failExp_58 GHC.Base.<> farExp_43
243 #)
244 GHC.Types.GT ->
245 (#
246 farInp_42,
247 farExp_43
248 #)
249 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_46 farInp_59 farExp_60
250 else
251 let _ = "choicesBranch.else"
252 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp_41 farInp_42 farExp_43
253 in let _ = "pushValue"
254 in let _ = "comment: satisfy"
255 in let inp_61 = init_1
256 in let readFail_62 = catchHandler_39
257 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=2"
258 in if readMore_2 (Symantic.Parser.Machine.Input.shiftRightText 1 inp_61)
259 then
260 let _ = "checkToken"
261 in let !(#
262 c_63,
263 cs_64
264 #) = readNext_3 inp_61
265 in if (GHC.Classes.==) 'a' c_63
266 then
267 let _ = "comment: satisfy"
268 in let _ = "checkHorizon.oldCheck: checkedHorizon=2"
269 in let _ = "checkToken"
270 in let !(#
271 c_65,
272 cs_66
273 #) = readNext_3 cs_64
274 in if (GHC.Classes.==) 'a' c_65
275 then
276 let _ = "commit"
277 in let _ = "resume"
278 in join_34
279 init_1
280 Data.Set.Internal.empty
281 ( let _ = "resume.genCode"
282 in (GHC.Types.:) 'a' ((GHC.Types.:) 'a' GHC.Types . [])
283 )
284 cs_66
285 else
286 let _ = "checkToken.fail"
287 in let failExp_67 =
288 Data.Set.Internal.Bin
289 1
290 ( Symantic.Parser.Grammar.Combinators.SomeFailure
291 ( case inputToken of
292 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
293 )
294 )
295 Data.Set.Internal.Tip
296 Data.Set.Internal.Tip
297 in let (#
298 farInp_68,
299 farExp_69
300 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 cs_64 of
301 GHC.Types.LT ->
302 (#
303 cs_64,
304 failExp_67
305 #)
306 GHC.Types.EQ ->
307 (#
308 init_1,
309 failExp_67 GHC.Base.<> Data.Set.Internal.empty
310 #)
311 GHC.Types.GT ->
312 (#
313 init_1,
314 Data.Set.Internal.empty
315 #)
316 in readFail_62 Symantic.Parser.Grammar.Combinators.ExceptionFailure cs_64 farInp_68 farExp_69
317 else
318 let _ = "checkToken.fail"
319 in let failExp_70 =
320 Data.Set.Internal.Bin
321 1
322 ( Symantic.Parser.Grammar.Combinators.SomeFailure
323 ( case inputToken of
324 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
325 )
326 )
327 Data.Set.Internal.Tip
328 Data.Set.Internal.Tip
329 in let (#
330 farInp_71,
331 farExp_72
332 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 inp_61 of
333 GHC.Types.LT ->
334 (#
335 inp_61,
336 failExp_70
337 #)
338 GHC.Types.EQ ->
339 (#
340 init_1,
341 failExp_70 GHC.Base.<> Data.Set.Internal.empty
342 #)
343 GHC.Types.GT ->
344 (#
345 init_1,
346 Data.Set.Internal.empty
347 #)
348 in readFail_62 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_61 farInp_71 farExp_72
349 else
350 let _ = "checkHorizon.newCheck.fail"
351 in let failExp_73 =
352 Data.Set.Internal.Bin
353 1
354 ( Symantic.Parser.Grammar.Combinators.SomeFailure
355 ( case inputToken of
356 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok'_6989586621679080671 2
357 )
358 )
359 Data.Set.Internal.Tip
360 Data.Set.Internal.Tip
361 in let (#
362 farInp_74,
363 farExp_75
364 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 inp_61 of
365 GHC.Types.LT ->
366 (#
367 inp_61,
368 failExp_73
369 #)
370 GHC.Types.EQ ->
371 (#
372 init_1,
373 failExp_73 GHC.Base.<> Data.Set.Internal.empty
374 #)
375 GHC.Types.GT ->
376 (#
377 init_1,
378 Data.Set.Internal.empty
379 #)
380 in readFail_62 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_61 farInp_74 farExp_75
381 )