]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G11.expected.txt
machine: make failure be minReads=0
[haskell/symantic-parser.git] / test / Golden / Splice / G11.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 _ = "comment: satisfy"
121 in let inp_46 = failInp_40
122 in let readFail_47 = finalRaise_18
123 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=1"
124 in if readMore_2 inp_46
125 then
126 let _ = "checkToken"
127 in let !(#
128 c_48,
129 cs_49
130 #) = readNext_3 inp_46
131 in if (GHC.Classes.==) 'b' c_48
132 then
133 let _ = "resume"
134 in finalRet_13
135 farInp_41
136 farExp_42
137 ( let _ = "resume.genCode"
138 in GHC.Show.show (sr_45 GHC.Types . [])
139 )
140 cs_49
141 else
142 let _ = "checkToken.fail"
143 in let failExp_50 =
144 Data.Set.Internal.Bin
145 1
146 ( Symantic.Parser.Grammar.Combinators.SomeFailure
147 ( case inputToken of
148 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'b'
149 )
150 )
151 Data.Set.Internal.Tip
152 Data.Set.Internal.Tip
153 in let (#
154 farInp_51,
155 farExp_52
156 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_41 inp_46 of
157 GHC.Types.LT ->
158 (#
159 inp_46,
160 failExp_50
161 #)
162 GHC.Types.EQ ->
163 (#
164 farInp_41,
165 failExp_50 GHC.Base.<> farExp_42
166 #)
167 GHC.Types.GT ->
168 (#
169 farInp_41,
170 farExp_42
171 #)
172 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_46 farInp_51 farExp_52
173 else
174 let _ = "checkHorizon.newCheck.fail"
175 in let failExp_53 =
176 Data.Set.Internal.Bin
177 1
178 ( Symantic.Parser.Grammar.Combinators.SomeFailure
179 ( case inputToken of
180 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok'_6989586621679080671 1
181 )
182 )
183 Data.Set.Internal.Tip
184 Data.Set.Internal.Tip
185 in let (#
186 farInp_54,
187 farExp_55
188 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp_41 inp_46 of
189 GHC.Types.LT ->
190 (#
191 inp_46,
192 failExp_53
193 #)
194 GHC.Types.EQ ->
195 (#
196 farInp_41,
197 failExp_53 GHC.Base.<> farExp_42
198 #)
199 GHC.Types.GT ->
200 (#
201 farInp_41,
202 farExp_42
203 #)
204 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_46 farInp_54 farExp_55
205 else
206 let _ = "choicesBranch.else"
207 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp_40 farInp_41 farExp_42
208 loop_56 = \_callReturn_57 callInput_58 callCatchStackByLabel_59 ->
209 let _ = "pushValue"
210 in let _ = "comment: satisfy"
211 in let inp_60 = callInput_58
212 in let readFail_61 = catchHandler_37 callInput_58
213 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=1"
214 in if readMore_2 inp_60
215 then
216 let _ = "checkToken"
217 in let !(#
218 c_62,
219 cs_63
220 #) = readNext_3 inp_60
221 in if (GHC.Classes.==) 'a' c_62
222 then
223 let _ = "pushValue"
224 in do
225 sr_64 <- GHC.STRef.readSTRef reg_36
226 do
227 let dupv_65 = \x_66 -> sr_64 ((GHC.Types.:) 'a' x_66)
228 GHC.STRef.writeSTRef reg_36 dupv_65
229 let _ = "jump"
230 in loop_56 (GHC.Err.error "invalid return") cs_63 (Data.Map.Internal.Bin 1 Symantic.Parser.Grammar.Combinators.ExceptionFailure readFail_61 Data.Map.Internal.Tip Data.Map.Internal.Tip)
231 else
232 let _ = "checkToken.fail"
233 in let failExp_67 =
234 Data.Set.Internal.Bin
235 1
236 ( Symantic.Parser.Grammar.Combinators.SomeFailure
237 ( case inputToken of
238 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
239 )
240 )
241 Data.Set.Internal.Tip
242 Data.Set.Internal.Tip
243 in let (#
244 farInp_68,
245 farExp_69
246 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 inp_60 of
247 GHC.Types.LT ->
248 (#
249 inp_60,
250 failExp_67
251 #)
252 GHC.Types.EQ ->
253 (#
254 init_1,
255 failExp_67 GHC.Base.<> Data.Set.Internal.empty
256 #)
257 GHC.Types.GT ->
258 (#
259 init_1,
260 Data.Set.Internal.empty
261 #)
262 in readFail_61 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_60 farInp_68 farExp_69
263 else
264 let _ = "checkHorizon.newCheck.fail"
265 in let failExp_70 =
266 Data.Set.Internal.Bin
267 1
268 ( Symantic.Parser.Grammar.Combinators.SomeFailure
269 ( case inputToken of
270 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok'_6989586621679080671 1
271 )
272 )
273 Data.Set.Internal.Tip
274 Data.Set.Internal.Tip
275 in let (#
276 farInp_71,
277 farExp_72
278 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 inp_60 of
279 GHC.Types.LT ->
280 (#
281 inp_60,
282 failExp_70
283 #)
284 GHC.Types.EQ ->
285 (#
286 init_1,
287 failExp_70 GHC.Base.<> Data.Set.Internal.empty
288 #)
289 GHC.Types.GT ->
290 (#
291 init_1,
292 Data.Set.Internal.empty
293 #)
294 in readFail_61 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_60 farInp_71 farExp_72
295 in let _ = "jump"
296 in loop_56 finalRet_13 init_1 Data.Map.Internal.Tip
297 )