]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G2.expected.txt
machine: make failure be minReads=0
[haskell/symantic-parser.git] / test / Golden / Splice / G2.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 _ = "catch ExceptionFailure"
96 in let catchHandler_34 (!_exn_35) (!failInp_36) (!farInp_37) (!farExp_38) =
97 let _ = "catch.ko ExceptionFailure"
98 in let _ = "loadInput"
99 in let _ = "checkHorizon.noCheck"
100 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure init_1 farInp_37 farExp_38
101 in let _ = "pushValue"
102 in let _ = "comment: satisfy"
103 in let inp_39 = init_1
104 in let readFail_40 = catchHandler_34
105 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=3"
106 in if readMore_2 (Symantic.Parser.Machine.Input.shiftRightText 2 inp_39)
107 then
108 let _ = "checkToken"
109 in let !(#
110 c_41,
111 cs_42
112 #) = readNext_3 inp_39
113 in if (GHC.Classes.==) 'a' c_41
114 then
115 let _ = "comment: satisfy"
116 in let _ = "checkHorizon.oldCheck: checkedHorizon=3"
117 in let _ = "checkToken"
118 in let !(#
119 c_43,
120 cs_44
121 #) = readNext_3 cs_42
122 in if (GHC.Classes.==) 'b' c_43
123 then
124 let _ = "comment: satisfy"
125 in let _ = "checkHorizon.oldCheck: checkedHorizon=2"
126 in let _ = "checkToken"
127 in let !(#
128 c_45,
129 cs_46
130 #) = readNext_3 cs_44
131 in if (GHC.Classes.==) 'c' c_45
132 then
133 let _ = "commit"
134 in let _ = "resume"
135 in finalRet_13
136 init_1
137 Data.Set.Internal.empty
138 ( let _ = "resume.genCode"
139 in GHC.Show.show ((GHC.Types.:) 'a' ((GHC.Types.:) 'b' ((GHC.Types.:) 'c' GHC.Types . [])))
140 )
141 cs_46
142 else
143 let _ = "checkToken.fail"
144 in let failExp_47 =
145 Data.Set.Internal.Bin
146 1
147 ( Symantic.Parser.Grammar.Combinators.SomeFailure
148 ( case inputToken of
149 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'c'
150 )
151 )
152 Data.Set.Internal.Tip
153 Data.Set.Internal.Tip
154 in let (#
155 farInp_48,
156 farExp_49
157 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 cs_44 of
158 GHC.Types.LT ->
159 (#
160 cs_44,
161 failExp_47
162 #)
163 GHC.Types.EQ ->
164 (#
165 init_1,
166 failExp_47 GHC.Base.<> Data.Set.Internal.empty
167 #)
168 GHC.Types.GT ->
169 (#
170 init_1,
171 Data.Set.Internal.empty
172 #)
173 in readFail_40 Symantic.Parser.Grammar.Combinators.ExceptionFailure cs_44 farInp_48 farExp_49
174 else
175 let _ = "checkToken.fail"
176 in let failExp_50 =
177 Data.Set.Internal.Bin
178 1
179 ( Symantic.Parser.Grammar.Combinators.SomeFailure
180 ( case inputToken of
181 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'b'
182 )
183 )
184 Data.Set.Internal.Tip
185 Data.Set.Internal.Tip
186 in let (#
187 farInp_51,
188 farExp_52
189 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 cs_42 of
190 GHC.Types.LT ->
191 (#
192 cs_42,
193 failExp_50
194 #)
195 GHC.Types.EQ ->
196 (#
197 init_1,
198 failExp_50 GHC.Base.<> Data.Set.Internal.empty
199 #)
200 GHC.Types.GT ->
201 (#
202 init_1,
203 Data.Set.Internal.empty
204 #)
205 in readFail_40 Symantic.Parser.Grammar.Combinators.ExceptionFailure cs_42 farInp_51 farExp_52
206 else
207 let _ = "checkToken.fail"
208 in let failExp_53 =
209 Data.Set.Internal.Bin
210 1
211 ( Symantic.Parser.Grammar.Combinators.SomeFailure
212 ( case inputToken of
213 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
214 )
215 )
216 Data.Set.Internal.Tip
217 Data.Set.Internal.Tip
218 in let (#
219 farInp_54,
220 farExp_55
221 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 inp_39 of
222 GHC.Types.LT ->
223 (#
224 inp_39,
225 failExp_53
226 #)
227 GHC.Types.EQ ->
228 (#
229 init_1,
230 failExp_53 GHC.Base.<> Data.Set.Internal.empty
231 #)
232 GHC.Types.GT ->
233 (#
234 init_1,
235 Data.Set.Internal.empty
236 #)
237 in readFail_40 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_39 farInp_54 farExp_55
238 else
239 let _ = "checkHorizon.newCheck.fail"
240 in let failExp_56 =
241 Data.Set.Internal.Bin
242 1
243 ( Symantic.Parser.Grammar.Combinators.SomeFailure
244 ( case inputToken of
245 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok'_6989586621679080671 3
246 )
247 )
248 Data.Set.Internal.Tip
249 Data.Set.Internal.Tip
250 in let (#
251 farInp_57,
252 farExp_58
253 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 inp_39 of
254 GHC.Types.LT ->
255 (#
256 inp_39,
257 failExp_56
258 #)
259 GHC.Types.EQ ->
260 (#
261 init_1,
262 failExp_56 GHC.Base.<> Data.Set.Internal.empty
263 #)
264 GHC.Types.GT ->
265 (#
266 init_1,
267 Data.Set.Internal.empty
268 #)
269 in readFail_40 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_39 farInp_57 farExp_58
270 )