]> Git — Sourcephile - haskell/symantic-parser.git/blob - tests/Golden/Splice/G20.expected.txt
wip
[haskell/symantic-parser.git] / tests / Golden / Splice / G20.expected.txt
1 \(input_0 :: inp_6989586621679041345) ->
2 let !(#
3 initBuffer_1,
4 initPos_2,
5 readMore_3,
6 readNext_4,
7 append_5
8 #) =
9 let next_6 buf_7 pos_8 =
10 let !( Data.Text.Unsafe.Iter
11 c_9
12 p_10
13 ) = Symantic.Parser.Machine.Input.Text.Buffer.iter buf_7 pos_8
14 in (#
15 c_9,
16 p_10
17 #)
18 more_11 buf_12 pos_13 = pos_13 GHC.Classes.< Symantic.Parser.Machine.Input.Text.Buffer.length buf_12
19 append_14 = Symantic.Parser.Machine.Input.Text.Buffer.pappend
20 in (#
21 Symantic.Parser.Machine.Input.Text.Buffer.buffer input_0,
22 0,
23 more_11,
24 next_6,
25 append_14
26 #)
27 finalRet_15 = \_farInp_16 _farExp_17 v_18 _inp_19 -> Symantic.Parser.Machine.Generate.returnST GHC.Base.$ Symantic.Parser.Machine.Generate.ResultDone v_18
28 finalRaise_20 ::
29 forall b_21.
30 Symantic.Parser.Machine.Generate.OnException
31 inp_6989586621679041345
32 b_21 = \(!exn_22) _failInp_23 (!farInp_24) (!farExp_25) buf_26 ->
33 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
34 Symantic.Parser.Machine.Generate.ResultError
35 Symantic.Parser.Machine.Generate.ParsingError
36 { Symantic.Parser.Machine.Generate.parsingErrorOffset = Symantic.Parser.Machine.Input.position farInp_24,
37 Symantic.Parser.Machine.Generate.parsingErrorException = exn_22,
38 Symantic.Parser.Machine.Generate.parsingErrorUnexpected =
39 if readMore_3 buf_26 farInp_24
40 then
41 GHC.Maybe.Just
42 ( let (#
43 c_27,
44 _
45 #) = readNext_4 buf_26 farInp_24
46 in c_27
47 )
48 else GHC.Maybe.Nothing,
49 Symantic.Parser.Machine.Generate.parsingErrorExpecting =
50 let ( minHoriz_28,
51 res_29
52 ) =
53 Data.Set.Internal.foldr
54 ( \f_30
55 ( minH_31,
56 acc_32
57 ) -> case Symantic.Parser.Grammar.Combinators.unSomeFailure f_30 of
58 GHC.Maybe.Just (Symantic.Parser.Grammar.Combinators.FailureHorizon h_33 :: Symantic.Parser.Grammar.Combinators.Failure (Symantic.Parser.Grammar.Combinators.CombSatisfiable (Symantic.Parser.Machine.Input.InputToken inp_6989586621679041345)))
59 | GHC.Maybe.Just old_34 <- minH_31 ->
60 ( GHC.Maybe.Just (GHC.Classes.min old_34 h_33),
61 acc_32
62 )
63 | GHC.Base.otherwise ->
64 ( GHC.Maybe.Just h_33,
65 acc_32
66 )
67 _ ->
68 ( minH_31,
69 f_30 GHC.Types.: acc_32
70 )
71 )
72 ( GHC.Maybe.Nothing,
73 GHC.Types . []
74 )
75 farExp_25
76 in Data.Set.Internal.fromList GHC.Base.$
77 ( case minHoriz_28 of
78 GHC.Maybe.Just h_35 -> Symantic.Parser.Grammar.Combinators.SomeFailure (Symantic.Parser.Grammar.Combinators.FailureHorizon @(Symantic.Parser.Machine.Input.InputToken inp_6989586621679041345) h_35) GHC.Types.: res_29
79 GHC.Maybe.Nothing -> res_29
80 )
81 }
82 in let inputToken = Data.Proxy.Proxy :: Data.Proxy.Proxy (Symantic.Parser.Machine.Input.InputToken inp_6989586621679041345)
83 in let partialCont_36 buf_37 =
84 let readFail_38 = finalRaise_20
85 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=3"
86 in if readMore_3 buf_37 ((GHC.Num.+) @GHC.Types.Int 2 initPos_2)
87 then
88 let
89 in let _ = "pushValue"
90 in let join_39 = \farInp_40 farExp_41 v_42 (!inp_43) ->
91 let _ = "lift2Value checkedHorizon=0"
92 in let _ = "catch ExceptionFailure checkedHorizon=0"
93 in let onException_44 =
94 let _ = "onException"
95 in \(!_exn_45) (!failInp_46) (!farInp_47) (!farExp_48) buf_49 ->
96 let _ = "loadInput checkedHorizon=0"
97 in let _ = "checkHorizon.noCheck"
98 in finalRaise_20 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_43 farInp_47 farExp_48 buf_49
99 in let _ = "pushValue"
100 in let _ = "comment: satisfy ((GHC.Classes.==) 'd')"
101 in let partialCont_50 buf_51 =
102 let readFail_52 = onException_44
103 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=3"
104 in if readMore_3 buf_51 ((GHC.Num.+) @GHC.Types.Int 2 inp_43)
105 then
106 let _ = "checkToken"
107 in let !(#
108 c_53,
109 cs_54
110 #) = readNext_4 buf_51 inp_43
111 in if (GHC.Classes.==) 'd' c_53
112 then
113 let _ = "lift2Value checkedHorizon=3"
114 in let _ = "comment: satisfy ((GHC.Classes.==) 'e')"
115 in let _ = "checkHorizon.oldCheck: checkedHorizon=3"
116 in let _ = "checkToken"
117 in let !(#
118 c_55,
119 cs_56
120 #) = readNext_4 buf_51 cs_54
121 in if (GHC.Classes.==) 'e' c_55
122 then
123 let _ = "lift2Value checkedHorizon=2"
124 in let _ = "comment: satisfy ((GHC.Classes.==) 'f')"
125 in let _ = "checkHorizon.oldCheck: checkedHorizon=2"
126 in let _ = "checkToken"
127 in let !(#
128 c_57,
129 cs_58
130 #) = readNext_4 buf_51 cs_56
131 in if (GHC.Classes.==) 'f' c_57
132 then
133 let _ = "lift2Value checkedHorizon=1"
134 in let _ = "commit"
135 in let _ = "lift2Value checkedHorizon=1"
136 in let _ = "resume"
137 in finalRet_15
138 farInp_40
139 farExp_41
140 ( let _ = "resume.genCode"
141 in GHC.Show.show GHC.Tuple . ()
142 )
143 cs_58
144 else
145 let _ = "checkToken.fail"
146 in readFail_52 Symantic.Parser.Grammar.Combinators.ExceptionFailure cs_56 farInp_40 farExp_41 buf_51
147 else
148 let _ = "checkToken.fail"
149 in readFail_52 Symantic.Parser.Grammar.Combinators.ExceptionFailure cs_54 farInp_40 farExp_41 buf_51
150 else
151 let _ = "checkToken.fail"
152 in readFail_52 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_43 farInp_40 farExp_41 buf_51
153 else
154 let _ = "checkHorizon.newCheck.fail"
155 in let failExp_59 =
156 Data.Set.Internal.Bin
157 1
158 ( Symantic.Parser.Grammar.Combinators.SomeFailure
159 ( case inputToken of
160 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679072653) -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok'_6989586621679072653 3
161 )
162 )
163 Data.Set.Internal.Tip
164 Data.Set.Internal.Tip
165 in let (#
166 farInp_60,
167 farExp_61
168 #) = case GHC.Classes.compare @GHC.Types.Int farInp_40 inp_43 of
169 GHC.Types.LT ->
170 (#
171 inp_43,
172 failExp_59
173 #)
174 GHC.Types.EQ ->
175 (#
176 farInp_40,
177 failExp_59 GHC.Base.<> farExp_41
178 #)
179 GHC.Types.GT ->
180 (#
181 farInp_40,
182 farExp_41
183 #)
184 in readFail_52 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_43 farInp_60 farExp_61 buf_51
185 in partialCont_50 buf_37
186 in let _ = "catch ExceptionFailure checkedHorizon=3"
187 in let onException_62 =
188 let _ = "onException"
189 in \(!_exn_63) (!failInp_64) (!farInp_65) (!farExp_66) buf_67 ->
190 let _ = "comment: raiseAgainIfConsumed"
191 in let _ = "saveInput checkedHorizon=0"
192 in let _ = "lift2Value checkedHorizon=0"
193 in if (GHC.Classes.==) @GHC.Types.Int initPos_2 failInp_64
194 then
195 let _ = "choicesBranch checkedHorizon=0"
196 in let _ = "catch ExceptionFailure checkedHorizon=0"
197 in let onException_68 =
198 let _ = "onException"
199 in \(!_exn_69) (!failInp_70) (!farInp_71) (!farExp_72) buf_73 ->
200 let _ = "loadInput checkedHorizon=0"
201 in let _ = "checkHorizon.noCheck"
202 in finalRaise_20 Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp_64 farInp_71 farExp_72 buf_73
203 in let _ = "pushValue"
204 in let _ = "commit"
205 in let _ = "resume"
206 in join_39
207 farInp_65
208 farExp_66
209 ( let _ = "resume.genCode"
210 in GHC.Types . []
211 )
212 failInp_64
213 else
214 let _ = "choicesBranch.else"
215 in finalRaise_20 Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp_64 farInp_65 farExp_66 buf_67
216 in let _ = "catch ExceptionFailure checkedHorizon=3"
217 in let onException_74 =
218 let _ = "onException"
219 in \(!_exn_75) (!failInp_76) (!farInp_77) (!farExp_78) buf_79 ->
220 let _ = "loadInput checkedHorizon=3"
221 in let _ = "checkHorizon.oldCheck: checkedHorizon=3"
222 in onException_62 Symantic.Parser.Grammar.Combinators.ExceptionFailure initPos_2 farInp_77 farExp_78 buf_79
223 in let _ = "pushValue"
224 in let _ = "comment: satisfy ((GHC.Classes.==) 'a')"
225 in let _ = "checkHorizon.oldCheck: checkedHorizon=3"
226 in let _ = "checkToken"
227 in let !(#
228 c_80,
229 cs_81
230 #) = readNext_4 buf_37 initPos_2
231 in if (GHC.Classes.==) 'a' c_80
232 then
233 let _ = "lift2Value checkedHorizon=2"
234 in let _ = "comment: satisfy ((GHC.Classes.==) 'b')"
235 in let _ = "checkHorizon.oldCheck: checkedHorizon=2"
236 in let _ = "checkToken"
237 in let !(#
238 c_82,
239 cs_83
240 #) = readNext_4 buf_37 cs_81
241 in if (GHC.Classes.==) 'b' c_82
242 then
243 let _ = "lift2Value checkedHorizon=1"
244 in let _ = "comment: satisfy ((GHC.Classes.==) 'c')"
245 in let _ = "checkHorizon.oldCheck: checkedHorizon=1"
246 in let _ = "checkToken"
247 in let !(#
248 c_84,
249 cs_85
250 #) = readNext_4 buf_37 cs_83
251 in if (GHC.Classes.==) 'c' c_84
252 then
253 let _ = "lift2Value checkedHorizon=0"
254 in let _ = "commit"
255 in let _ = "commit"
256 in let _ = "resume"
257 in join_39
258 initPos_2
259 Data.Set.Internal.empty
260 ( let _ = "resume.genCode"
261 in (GHC.Types.:) 'a' ((GHC.Types.:) 'b' ((GHC.Types.:) 'c' GHC.Types . []))
262 )
263 cs_85
264 else
265 let _ = "checkToken.fail"
266 in onException_74 Symantic.Parser.Grammar.Combinators.ExceptionFailure cs_83 initPos_2 Data.Set.Internal.empty buf_37
267 else
268 let _ = "checkToken.fail"
269 in onException_74 Symantic.Parser.Grammar.Combinators.ExceptionFailure cs_81 initPos_2 Data.Set.Internal.empty buf_37
270 else
271 let _ = "checkToken.fail"
272 in onException_74 Symantic.Parser.Grammar.Combinators.ExceptionFailure initPos_2 initPos_2 Data.Set.Internal.empty buf_37
273 else
274 let _ = "checkHorizon.newCheck.fail"
275 in let failExp_86 =
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'_6989586621679072653) -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok'_6989586621679072653 3
281 )
282 )
283 Data.Set.Internal.Tip
284 Data.Set.Internal.Tip
285 in let (#
286 farInp_87,
287 farExp_88
288 #) = case GHC.Classes.compare @GHC.Types.Int initPos_2 initPos_2 of
289 GHC.Types.LT ->
290 (#
291 initPos_2,
292 failExp_86
293 #)
294 GHC.Types.EQ ->
295 (#
296 initPos_2,
297 failExp_86 GHC.Base.<> Data.Set.Internal.empty
298 #)
299 GHC.Types.GT ->
300 (#
301 initPos_2,
302 Data.Set.Internal.empty
303 #)
304 in finalRaise_20 Symantic.Parser.Grammar.Combinators.ExceptionFailure initPos_2 farInp_87 farExp_88 buf_37
305 in partialCont_36 initBuffer_1