]> Git — Sourcephile - haskell/symantic-parser.git/blob - tests/Golden/Splice/G2.expected.txt
wip
[haskell/symantic-parser.git] / tests / Golden / Splice / G2.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 _ = "catch ExceptionFailure checkedHorizon=3"
91 in let onException_39 =
92 let _ = "onException"
93 in \(!_exn_40) (!failInp_41) (!farInp_42) (!farExp_43) buf_44 ->
94 let _ = "loadInput checkedHorizon=3"
95 in let _ = "checkHorizon.oldCheck: checkedHorizon=3"
96 in finalRaise_20 Symantic.Parser.Grammar.Combinators.ExceptionFailure initPos_2 farInp_42 farExp_43 buf_44
97 in let _ = "pushValue"
98 in let _ = "comment: satisfy ((GHC.Classes.==) 'a')"
99 in let _ = "checkHorizon.oldCheck: checkedHorizon=3"
100 in let _ = "checkToken"
101 in let !(#
102 c_45,
103 cs_46
104 #) = readNext_4 buf_37 initPos_2
105 in if (GHC.Classes.==) 'a' c_45
106 then
107 let _ = "lift2Value checkedHorizon=2"
108 in let _ = "comment: satisfy ((GHC.Classes.==) 'b')"
109 in let _ = "checkHorizon.oldCheck: checkedHorizon=2"
110 in let _ = "checkToken"
111 in let !(#
112 c_47,
113 cs_48
114 #) = readNext_4 buf_37 cs_46
115 in if (GHC.Classes.==) 'b' c_47
116 then
117 let _ = "lift2Value checkedHorizon=1"
118 in let _ = "comment: satisfy ((GHC.Classes.==) 'c')"
119 in let _ = "checkHorizon.oldCheck: checkedHorizon=1"
120 in let _ = "checkToken"
121 in let !(#
122 c_49,
123 cs_50
124 #) = readNext_4 buf_37 cs_48
125 in if (GHC.Classes.==) 'c' c_49
126 then
127 let _ = "lift2Value checkedHorizon=0"
128 in let _ = "commit"
129 in let _ = "lift2Value checkedHorizon=0"
130 in let _ = "resume"
131 in finalRet_15
132 initPos_2
133 Data.Set.Internal.empty
134 ( let _ = "resume.genCode"
135 in GHC.Show.show ((GHC.Types.:) 'a' ((GHC.Types.:) 'b' ((GHC.Types.:) 'c' GHC.Types . [])))
136 )
137 cs_50
138 else
139 let _ = "checkToken.fail"
140 in let failExp_51 =
141 Data.Set.Internal.Bin
142 1
143 ( Symantic.Parser.Grammar.Combinators.SomeFailure
144 ( case inputToken of
145 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679072653) -> Symantic.Parser.Grammar.Combinators.FailureToken 'c'
146 )
147 )
148 Data.Set.Internal.Tip
149 Data.Set.Internal.Tip
150 in let (#
151 farInp_52,
152 farExp_53
153 #) = case GHC.Classes.compare @GHC.Types.Int initPos_2 cs_48 of
154 GHC.Types.LT ->
155 (#
156 cs_48,
157 failExp_51
158 #)
159 GHC.Types.EQ ->
160 (#
161 initPos_2,
162 failExp_51 GHC.Base.<> Data.Set.Internal.empty
163 #)
164 GHC.Types.GT ->
165 (#
166 initPos_2,
167 Data.Set.Internal.empty
168 #)
169 in onException_39 Symantic.Parser.Grammar.Combinators.ExceptionFailure cs_48 farInp_52 farExp_53 buf_37
170 else
171 let _ = "checkToken.fail"
172 in let failExp_54 =
173 Data.Set.Internal.Bin
174 1
175 ( Symantic.Parser.Grammar.Combinators.SomeFailure
176 ( case inputToken of
177 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679072653) -> Symantic.Parser.Grammar.Combinators.FailureToken 'b'
178 )
179 )
180 Data.Set.Internal.Tip
181 Data.Set.Internal.Tip
182 in let (#
183 farInp_55,
184 farExp_56
185 #) = case GHC.Classes.compare @GHC.Types.Int initPos_2 cs_46 of
186 GHC.Types.LT ->
187 (#
188 cs_46,
189 failExp_54
190 #)
191 GHC.Types.EQ ->
192 (#
193 initPos_2,
194 failExp_54 GHC.Base.<> Data.Set.Internal.empty
195 #)
196 GHC.Types.GT ->
197 (#
198 initPos_2,
199 Data.Set.Internal.empty
200 #)
201 in onException_39 Symantic.Parser.Grammar.Combinators.ExceptionFailure cs_46 farInp_55 farExp_56 buf_37
202 else
203 let _ = "checkToken.fail"
204 in let failExp_57 =
205 Data.Set.Internal.Bin
206 1
207 ( Symantic.Parser.Grammar.Combinators.SomeFailure
208 ( case inputToken of
209 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679072653) -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
210 )
211 )
212 Data.Set.Internal.Tip
213 Data.Set.Internal.Tip
214 in let (#
215 farInp_58,
216 farExp_59
217 #) = case GHC.Classes.compare @GHC.Types.Int initPos_2 initPos_2 of
218 GHC.Types.LT ->
219 (#
220 initPos_2,
221 failExp_57
222 #)
223 GHC.Types.EQ ->
224 (#
225 initPos_2,
226 failExp_57 GHC.Base.<> Data.Set.Internal.empty
227 #)
228 GHC.Types.GT ->
229 (#
230 initPos_2,
231 Data.Set.Internal.empty
232 #)
233 in onException_39 Symantic.Parser.Grammar.Combinators.ExceptionFailure initPos_2 farInp_58 farExp_59 buf_37
234 else
235 let _ = "checkHorizon.newCheck.fail"
236 in let failExp_60 =
237 Data.Set.Internal.Bin
238 1
239 ( Symantic.Parser.Grammar.Combinators.SomeFailure
240 ( case inputToken of
241 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok'_6989586621679072653) -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok'_6989586621679072653 3
242 )
243 )
244 Data.Set.Internal.Tip
245 Data.Set.Internal.Tip
246 in let (#
247 farInp_61,
248 farExp_62
249 #) = case GHC.Classes.compare @GHC.Types.Int initPos_2 initPos_2 of
250 GHC.Types.LT ->
251 (#
252 initPos_2,
253 failExp_60
254 #)
255 GHC.Types.EQ ->
256 (#
257 initPos_2,
258 failExp_60 GHC.Base.<> Data.Set.Internal.empty
259 #)
260 GHC.Types.GT ->
261 (#
262 initPos_2,
263 Data.Set.Internal.empty
264 #)
265 in finalRaise_20 Symantic.Parser.Grammar.Combinators.ExceptionFailure initPos_2 farInp_61 farExp_62 buf_37
266 in partialCont_36 initBuffer_1