]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G10.expected.txt
machine: make failure be minReads=0
[haskell/symantic-parser.git] / test / Golden / Splice / G10.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=1"
128 in if readMore_2 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.==) 'b' c_48
136 then
137 let _ = "resume"
138 in join_34
139 farInp_42
140 farExp_43
141 ( let _ = "resume.genCode"
142 in 'b'
143 )
144 cs_49
145 else
146 let _ = "checkToken.fail"
147 in let failExp_50 =
148 Data.Set.Internal.Bin
149 1
150 ( Symantic.Parser.Grammar.Combinators.SomeFailure
151 ( case inputToken of
152 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'b'
153 )
154 )
155 Data.Set.Internal.Tip
156 Data.Set.Internal.Tip
157 in let (#
158 farInp_51,
159 farExp_52
160 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_42 inp_46 of
161 GHC.Types.LT ->
162 (#
163 inp_46,
164 failExp_50
165 #)
166 GHC.Types.EQ ->
167 (#
168 farInp_42,
169 failExp_50 GHC.Base.<> farExp_43
170 #)
171 GHC.Types.GT ->
172 (#
173 farInp_42,
174 farExp_43
175 #)
176 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_46 farInp_51 farExp_52
177 else
178 let _ = "checkHorizon.newCheck.fail"
179 in let failExp_53 =
180 Data.Set.Internal.Bin
181 1
182 ( Symantic.Parser.Grammar.Combinators.SomeFailure
183 ( case inputToken of
184 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok'_6989586621679080671 1
185 )
186 )
187 Data.Set.Internal.Tip
188 Data.Set.Internal.Tip
189 in let (#
190 farInp_54,
191 farExp_55
192 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_42 inp_46 of
193 GHC.Types.LT ->
194 (#
195 inp_46,
196 failExp_53
197 #)
198 GHC.Types.EQ ->
199 (#
200 farInp_42,
201 failExp_53 GHC.Base.<> farExp_43
202 #)
203 GHC.Types.GT ->
204 (#
205 farInp_42,
206 farExp_43
207 #)
208 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_46 farInp_54 farExp_55
209 else
210 let _ = "choicesBranch.else"
211 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp_41 farInp_42 farExp_43
212 in let _ = "pushValue"
213 in let _ = "comment: satisfy"
214 in let inp_56 = init_1
215 in let readFail_57 = catchHandler_39
216 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=1"
217 in if readMore_2 inp_56
218 then
219 let _ = "checkToken"
220 in let !(#
221 c_58,
222 cs_59
223 #) = readNext_3 inp_56
224 in if (GHC.Classes.==) 'a' c_58
225 then
226 let _ = "commit"
227 in let _ = "resume"
228 in join_34
229 init_1
230 Data.Set.Internal.empty
231 ( let _ = "resume.genCode"
232 in 'a'
233 )
234 cs_59
235 else
236 let _ = "checkToken.fail"
237 in let failExp_60 =
238 Data.Set.Internal.Bin
239 1
240 ( Symantic.Parser.Grammar.Combinators.SomeFailure
241 ( case inputToken of
242 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
243 )
244 )
245 Data.Set.Internal.Tip
246 Data.Set.Internal.Tip
247 in let (#
248 farInp_61,
249 farExp_62
250 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 inp_56 of
251 GHC.Types.LT ->
252 (#
253 inp_56,
254 failExp_60
255 #)
256 GHC.Types.EQ ->
257 (#
258 init_1,
259 failExp_60 GHC.Base.<> Data.Set.Internal.empty
260 #)
261 GHC.Types.GT ->
262 (#
263 init_1,
264 Data.Set.Internal.empty
265 #)
266 in readFail_57 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_56 farInp_61 farExp_62
267 else
268 let _ = "checkHorizon.newCheck.fail"
269 in let failExp_63 =
270 Data.Set.Internal.Bin
271 1
272 ( Symantic.Parser.Grammar.Combinators.SomeFailure
273 ( case inputToken of
274 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok'_6989586621679080671 1
275 )
276 )
277 Data.Set.Internal.Tip
278 Data.Set.Internal.Tip
279 in let (#
280 farInp_64,
281 farExp_65
282 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 inp_56 of
283 GHC.Types.LT ->
284 (#
285 inp_56,
286 failExp_63
287 #)
288 GHC.Types.EQ ->
289 (#
290 init_1,
291 failExp_63 GHC.Base.<> Data.Set.Internal.empty
292 #)
293 GHC.Types.GT ->
294 (#
295 init_1,
296 Data.Set.Internal.empty
297 #)
298 in readFail_57 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_56 farInp_64 farExp_65
299 )