]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G20.expected.txt
rename {catcher => onException}
[haskell/symantic-parser.git] / test / Golden / Splice / G20.expected.txt
1 \(input_0 :: inp_6989586621679141738) ->
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_6989586621679141738
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_6989586621679141738)))
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_6989586621679141738) 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_6989586621679141738)
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 _ = "catch ExceptionFailure"
97 in let onException_39 (!_exn_40) (!failInp_41) (!farInp_42) (!farExp_43) =
98 let _ = "catch.ko ExceptionFailure"
99 in let _ = "loadInput"
100 in let _ = "checkHorizon.noCheck"
101 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_38 farInp_42 farExp_43
102 in let _ = "pushValue"
103 in let _ = "comment: satisfy"
104 in let inp_44 = inp_38
105 in let readFail_45 = onException_39
106 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=3"
107 in if readMore_2 (Symantic.Parser.Machine.Input.shiftRightText 2 inp_44)
108 then
109 let _ = "checkToken"
110 in let !(#
111 c_46,
112 cs_47
113 #) = readNext_3 inp_44
114 in if (GHC.Classes.==) 'd' c_46
115 then
116 let _ = "comment: satisfy"
117 in let _ = "checkHorizon.oldCheck: checkedHorizon=3"
118 in let _ = "checkToken"
119 in let !(#
120 c_48,
121 cs_49
122 #) = readNext_3 cs_47
123 in if (GHC.Classes.==) 'e' c_48
124 then
125 let _ = "comment: satisfy"
126 in let _ = "checkHorizon.oldCheck: checkedHorizon=2"
127 in let _ = "checkToken"
128 in let !(#
129 c_50,
130 cs_51
131 #) = readNext_3 cs_49
132 in if (GHC.Classes.==) 'f' c_50
133 then
134 let _ = "commit"
135 in let _ = "resume"
136 in finalRet_13
137 farInp_35
138 farExp_36
139 ( let _ = "resume.genCode"
140 in GHC.Show.show GHC.Tuple . ()
141 )
142 cs_51
143 else
144 let _ = "checkToken.fail"
145 in readFail_45 Symantic.Parser.Grammar.Combinators.ExceptionFailure cs_49 farInp_35 farExp_36
146 else
147 let _ = "checkToken.fail"
148 in readFail_45 Symantic.Parser.Grammar.Combinators.ExceptionFailure cs_47 farInp_35 farExp_36
149 else
150 let _ = "checkToken.fail"
151 in readFail_45 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_44 farInp_35 farExp_36
152 else
153 let _ = "checkHorizon.newCheck.fail"
154 in let failExp_52 =
155 Data.Set.Internal.Bin
156 1
157 ( Symantic.Parser.Grammar.Combinators.SomeFailure
158 ( case inputToken of
159 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok'_6989586621679080671 3
160 )
161 )
162 Data.Set.Internal.Tip
163 Data.Set.Internal.Tip
164 in let (#
165 farInp_53,
166 farExp_54
167 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_35 inp_44 of
168 GHC.Types.LT ->
169 (#
170 inp_44,
171 failExp_52
172 #)
173 GHC.Types.EQ ->
174 (#
175 farInp_35,
176 failExp_52 GHC.Base.<> farExp_36
177 #)
178 GHC.Types.GT ->
179 (#
180 farInp_35,
181 farExp_36
182 #)
183 in readFail_45 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_44 farInp_53 farExp_54
184 in let _ = "catch ExceptionFailure"
185 in let onException_55 (!_exn_56) (!failInp_57) (!farInp_58) (!farExp_59) =
186 let _ = "catch.ko ExceptionFailure"
187 in let _ = "pushInput"
188 in if ( \( Data.Text.Internal.Text
189 _
190 i_60
191 _
192 )
193 ( Data.Text.Internal.Text
194 _
195 j_61
196 _
197 ) -> i_60 GHC.Classes.== j_61
198 )
199 init_1
200 failInp_57
201 then
202 let _ = "choicesBranch.then"
203 in let _ = "catch ExceptionFailure"
204 in let onException_62 (!_exn_63) (!failInp_64) (!farInp_65) (!farExp_66) =
205 let _ = "catch.ko ExceptionFailure"
206 in let _ = "loadInput"
207 in let _ = "checkHorizon.noCheck"
208 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp_57 farInp_65 farExp_66
209 in let _ = "pushValue"
210 in let _ = "commit"
211 in let _ = "resume"
212 in join_34
213 farInp_58
214 farExp_59
215 ( let _ = "resume.genCode"
216 in GHC.Types . []
217 )
218 failInp_57
219 else
220 let _ = "choicesBranch.else"
221 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp_57 farInp_58 farExp_59
222 in let _ = "catch ExceptionFailure"
223 in let onException_67 (!_exn_68) (!failInp_69) (!farInp_70) (!farExp_71) =
224 let _ = "catch.ko ExceptionFailure"
225 in let _ = "loadInput"
226 in let _ = "checkHorizon.noCheck"
227 in onException_55 Symantic.Parser.Grammar.Combinators.ExceptionFailure init_1 farInp_70 farExp_71
228 in let _ = "pushValue"
229 in let _ = "comment: satisfy"
230 in let inp_72 = init_1
231 in let readFail_73 = onException_67
232 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=3"
233 in if readMore_2 (Symantic.Parser.Machine.Input.shiftRightText 2 inp_72)
234 then
235 let _ = "checkToken"
236 in let !(#
237 c_74,
238 cs_75
239 #) = readNext_3 inp_72
240 in if (GHC.Classes.==) 'a' c_74
241 then
242 let _ = "comment: satisfy"
243 in let _ = "checkHorizon.oldCheck: checkedHorizon=3"
244 in let _ = "checkToken"
245 in let !(#
246 c_76,
247 cs_77
248 #) = readNext_3 cs_75
249 in if (GHC.Classes.==) 'b' c_76
250 then
251 let _ = "comment: satisfy"
252 in let _ = "checkHorizon.oldCheck: checkedHorizon=2"
253 in let _ = "checkToken"
254 in let !(#
255 c_78,
256 cs_79
257 #) = readNext_3 cs_77
258 in if (GHC.Classes.==) 'c' c_78
259 then
260 let _ = "commit"
261 in let _ = "commit"
262 in let _ = "resume"
263 in join_34
264 init_1
265 Data.Set.Internal.empty
266 ( let _ = "resume.genCode"
267 in (GHC.Types.:) 'a' ((GHC.Types.:) 'b' ((GHC.Types.:) 'c' GHC.Types . []))
268 )
269 cs_79
270 else
271 let _ = "checkToken.fail"
272 in readFail_73 Symantic.Parser.Grammar.Combinators.ExceptionFailure cs_77 init_1 Data.Set.Internal.empty
273 else
274 let _ = "checkToken.fail"
275 in readFail_73 Symantic.Parser.Grammar.Combinators.ExceptionFailure cs_75 init_1 Data.Set.Internal.empty
276 else
277 let _ = "checkToken.fail"
278 in readFail_73 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_72 init_1 Data.Set.Internal.empty
279 else
280 let _ = "checkHorizon.newCheck.fail"
281 in let failExp_80 =
282 Data.Set.Internal.Bin
283 1
284 ( Symantic.Parser.Grammar.Combinators.SomeFailure
285 ( case inputToken of
286 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok'_6989586621679080671 3
287 )
288 )
289 Data.Set.Internal.Tip
290 Data.Set.Internal.Tip
291 in let (#
292 farInp_81,
293 farExp_82
294 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 inp_72 of
295 GHC.Types.LT ->
296 (#
297 inp_72,
298 failExp_80
299 #)
300 GHC.Types.EQ ->
301 (#
302 init_1,
303 failExp_80 GHC.Base.<> Data.Set.Internal.empty
304 #)
305 GHC.Types.GT ->
306 (#
307 init_1,
308 Data.Set.Internal.empty
309 #)
310 in readFail_73 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_72 farInp_81 farExp_82
311 )