]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G12.expected.txt
machine: make failure be minReads=0
[haskell/symantic-parser.git] / test / Golden / Splice / G12.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 _ = "pushValue"
96 in do
97 let dupv_34 = \x_35 -> x_35
98 reg_36 <- GHC.STRef.newSTRef dupv_34
99 let _ = "iter"
100 in let catchHandler_37 loopInput_38 (!_exn_39) (!failInp_40) (!farInp_41) (!farExp_42) =
101 let _ = "pushInput"
102 in if ( \( Data.Text.Internal.Text
103 _
104 i_43
105 _
106 )
107 ( Data.Text.Internal.Text
108 _
109 j_44
110 _
111 ) -> i_43 GHC.Classes.== j_44
112 )
113 loopInput_38
114 failInp_40
115 then
116 let _ = "choicesBranch.then"
117 in do
118 sr_45 <- GHC.STRef.readSTRef reg_36
119 let _ = "pushValue"
120 in let join_46 = \farInp_47 farExp_48 v_49 (!inp_50) ->
121 let _ = "resume"
122 in finalRet_13
123 farInp_47
124 farExp_48
125 ( let _ = "resume.genCode"
126 in GHC.Show.show (sr_45 GHC.Types . [])
127 )
128 inp_50
129 in let _ = "catch ExceptionFailure"
130 in let catchHandler_51 (!_exn_52) (!failInp_53) (!farInp_54) (!farExp_55) =
131 let _ = "catch.ko ExceptionFailure"
132 in let _ = "pushInput"
133 in if ( \( Data.Text.Internal.Text
134 _
135 i_56
136 _
137 )
138 ( Data.Text.Internal.Text
139 _
140 j_57
141 _
142 ) -> i_56 GHC.Classes.== j_57
143 )
144 failInp_40
145 failInp_53
146 then
147 let _ = "choicesBranch.then"
148 in let _ = "comment: eof.fail"
149 in let failExp_58 = Data.Set.Internal.Bin 1 (Symantic.Parser.Grammar.Combinators.SomeFailure Symantic.Parser.Grammar.Combinators.FailureEnd) Data.Set.Internal.Tip Data.Set.Internal.Tip
150 in let (#
151 farInp_59,
152 farExp_60
153 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_54 failInp_53 of
154 GHC.Types.LT ->
155 (#
156 failInp_53,
157 failExp_58
158 #)
159 GHC.Types.EQ ->
160 (#
161 farInp_54,
162 failExp_58 GHC.Base.<> farExp_55
163 #)
164 GHC.Types.GT ->
165 (#
166 farInp_54,
167 farExp_55
168 #)
169 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp_53 farInp_59 farExp_60
170 else
171 let _ = "choicesBranch.else"
172 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp_53 farInp_54 farExp_55
173 in let _ = "comment: negLook"
174 in let _ = "catch ExceptionFailure"
175 in let catchHandler_61 (!_exn_62) (!failInp_63) (!farInp_64) (!farExp_65) =
176 let _ = "catch.ko ExceptionFailure"
177 in let _ = "comment: negLook.reset"
178 in let _ = "loadInput"
179 in let _ = "checkHorizon.noCheck"
180 in let _ = "pushValue"
181 in let _ = "commit"
182 in let _ = "resume"
183 in join_46
184 farInp_64
185 farExp_65
186 ( let _ = "resume.genCode"
187 in GHC.Tuple . ()
188 )
189 failInp_40
190 in let _ = "comment: negLook.ahead"
191 in let _ = "pushInput"
192 in let _ = "comment: satisfy"
193 in let inp_66 = failInp_40
194 in let readFail_67 = catchHandler_61
195 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=1"
196 in if readMore_2 inp_66
197 then
198 let _ = "checkToken"
199 in let !(#
200 c_68,
201 cs_69
202 #) = readNext_3 inp_66
203 in let _ = "popValue"
204 in let _ = "commit"
205 in let _ = "loadInput"
206 in let _ = "checkHorizon.noCheck"
207 in catchHandler_51 Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp_40 farInp_41 farExp_42
208 else
209 let _ = "checkHorizon.newCheck.fail"
210 in let failExp_70 =
211 Data.Set.Internal.Bin
212 1
213 ( Symantic.Parser.Grammar.Combinators.SomeFailure
214 ( case inputToken of
215 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok'_6989586621679080671 1
216 )
217 )
218 Data.Set.Internal.Tip
219 Data.Set.Internal.Tip
220 in let (#
221 farInp_71,
222 farExp_72
223 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_41 inp_66 of
224 GHC.Types.LT ->
225 (#
226 inp_66,
227 failExp_70
228 #)
229 GHC.Types.EQ ->
230 (#
231 farInp_41,
232 failExp_70 GHC.Base.<> farExp_42
233 #)
234 GHC.Types.GT ->
235 (#
236 farInp_41,
237 farExp_42
238 #)
239 in readFail_67 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_66 farInp_71 farExp_72
240 else
241 let _ = "choicesBranch.else"
242 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp_40 farInp_41 farExp_42
243 loop_73 = \_callReturn_74 callInput_75 callCatchStackByLabel_76 ->
244 let _ = "pushValue"
245 in let _ = "comment: satisfy"
246 in let inp_77 = callInput_75
247 in let readFail_78 = catchHandler_37 callInput_75
248 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=1"
249 in if readMore_2 inp_77
250 then
251 let _ = "checkToken"
252 in let !(#
253 c_79,
254 cs_80
255 #) = readNext_3 inp_77
256 in if (\t_81 -> ('a' GHC.Classes.== t_81) GHC.Classes.|| (('b' GHC.Classes.== t_81) GHC.Classes.|| (('c' GHC.Classes.== t_81) GHC.Classes.|| (('d' GHC.Classes.== t_81) GHC.Classes.|| GHC.Types.False)))) c_79
257 then
258 let _ = "pushValue"
259 in do
260 sr_82 <- GHC.STRef.readSTRef reg_36
261 do
262 let dupv_83 = \x_84 -> sr_82 ((GHC.Types.:) c_79 x_84)
263 GHC.STRef.writeSTRef reg_36 dupv_83
264 let _ = "jump"
265 in loop_73 (GHC.Err.error "invalid return") cs_80 (Data.Map.Internal.Bin 1 Symantic.Parser.Grammar.Combinators.ExceptionFailure readFail_78 Data.Map.Internal.Tip Data.Map.Internal.Tip)
266 else
267 let _ = "checkToken.fail"
268 in let failExp_85 =
269 Data.Set.Internal.Bin
270 4
271 ( Symantic.Parser.Grammar.Combinators.SomeFailure
272 ( case inputToken of
273 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'b'
274 )
275 )
276 ( Data.Set.Internal.Bin
277 1
278 ( Symantic.Parser.Grammar.Combinators.SomeFailure
279 ( case inputToken of
280 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
281 )
282 )
283 Data.Set.Internal.Tip
284 Data.Set.Internal.Tip
285 )
286 ( Data.Set.Internal.Bin
287 2
288 ( Symantic.Parser.Grammar.Combinators.SomeFailure
289 ( case inputToken of
290 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'c'
291 )
292 )
293 Data.Set.Internal.Tip
294 ( Data.Set.Internal.Bin
295 1
296 ( Symantic.Parser.Grammar.Combinators.SomeFailure
297 ( case inputToken of
298 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'd'
299 )
300 )
301 Data.Set.Internal.Tip
302 Data.Set.Internal.Tip
303 )
304 )
305 in let (#
306 farInp_86,
307 farExp_87
308 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 inp_77 of
309 GHC.Types.LT ->
310 (#
311 inp_77,
312 failExp_85
313 #)
314 GHC.Types.EQ ->
315 (#
316 init_1,
317 failExp_85 GHC.Base.<> Data.Set.Internal.empty
318 #)
319 GHC.Types.GT ->
320 (#
321 init_1,
322 Data.Set.Internal.empty
323 #)
324 in readFail_78 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_77 farInp_86 farExp_87
325 else
326 let _ = "checkHorizon.newCheck.fail"
327 in let failExp_88 =
328 Data.Set.Internal.Bin
329 1
330 ( Symantic.Parser.Grammar.Combinators.SomeFailure
331 ( case inputToken of
332 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok'_6989586621679080671 1
333 )
334 )
335 Data.Set.Internal.Tip
336 Data.Set.Internal.Tip
337 in let (#
338 farInp_89,
339 farExp_90
340 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 inp_77 of
341 GHC.Types.LT ->
342 (#
343 inp_77,
344 failExp_88
345 #)
346 GHC.Types.EQ ->
347 (#
348 init_1,
349 failExp_88 GHC.Base.<> Data.Set.Internal.empty
350 #)
351 GHC.Types.GT ->
352 (#
353 init_1,
354 Data.Set.Internal.empty
355 #)
356 in readFail_78 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_77 farInp_89 farExp_90
357 in let _ = "jump"
358 in loop_73 finalRet_13 init_1 Data.Map.Internal.Tip
359 )