]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G6.expected.txt
replace ValueCode by Production
[haskell/symantic-parser.git] / test / Golden / Splice / G6.expected.txt
1 \(input :: inp) ->
2 let !(#
3 init,
4 readMore,
5 readNext
6 #) =
7 let _ = "cursorOf"
8 in let next
9 ( t@( Data.Text.Internal.Text
10 arr
11 off
12 unconsumed
13 )
14 ) =
15 let !( Data.Text.Unsafe.Iter
16 c
17 d
18 ) = Data.Text.Unsafe.iter t 0
19 in (#
20 c,
21 Data.Text.Internal.Text arr (off GHC.Num.+ d) (unconsumed GHC.Num.- d)
22 #)
23 more
24 ( Data.Text.Internal.Text
25 _
26 _
27 unconsumed
28 ) = unconsumed GHC.Classes.> 0
29 in (# input, more, next #)
30 finalRet = \_farInp _farExp v _inp -> Data.Either.Right v
31 finalRaise ::
32 forall b.
33 Symantic.Parser.Machine.Generate.Catcher
34 inp
35 b = \(!exn) _failInp (!farInp) (!farExp) ->
36 Data.Either.Left
37 Symantic.Parser.Machine.Generate.ParsingErrorStandard
38 { Symantic.Parser.Machine.Generate.parsingErrorOffset = Symantic.Parser.Machine.Input.offset farInp,
39 Symantic.Parser.Machine.Generate.parsingErrorException = exn,
40 Symantic.Parser.Machine.Generate.parsingErrorUnexpected =
41 if readMore farInp
42 then
43 GHC.Maybe.Just
44 ( let (#
45 c,
46 _
47 #) = readNext farInp
48 in c
49 )
50 else GHC.Maybe.Nothing,
51 Symantic.Parser.Machine.Generate.parsingErrorExpecting = farExp
52 }
53 in let inputToken = Data.Proxy.Proxy :: Data.Proxy.Proxy (Symantic.Parser.Machine.Input.InputToken inp)
54 in let
55 in let join = \farInp farExp v (!inp) ->
56 let _ = "resume"
57 in finalRet
58 farInp
59 farExp
60 ( let _ = "resume.genCode"
61 in GHC.Show.show v
62 )
63 inp
64 in let _ = "catch ExceptionFailure"
65 in let catchHandler (!_exn) (!failInp) (!farInp) (!farExp) =
66 let _ = "catch.ko ExceptionFailure"
67 in if ( \( Data.Text.Internal.Text
68 _
69 i
70 _
71 )
72 ( Data.Text.Internal.Text
73 _
74 j
75 _
76 ) -> i GHC.Classes.== j
77 )
78 init
79 failInp
80 then
81 let _ = "choicesBranch.then"
82 in let readFail = finalRaise
83 in if readMore (Symantic.Parser.Machine.Input.shiftRightText 1 failInp)
84 then
85 let !(#
86 c,
87 cs
88 #) = readNext failInp
89 in if ('a' GHC.Classes.==) c
90 then
91 let readFail = finalRaise
92 in let !(#
93 c,
94 cs
95 #) = readNext cs
96 in if ('b' GHC.Classes.==) c
97 then
98 let _ = "resume"
99 in join
100 farInp
101 farExp
102 ( let _ = "resume.genCode"
103 in 'a' GHC.Types.: ('b' GHC.Types.: GHC.Types . [])
104 )
105 cs
106 else
107 let _ = "checkToken.else"
108 in let failExp =
109 Data.Set.Internal.Bin
110 1
111 ( Symantic.Parser.Grammar.Combinators.SomeFailure
112 ( case inputToken of
113 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'b'
114 )
115 )
116 Data.Set.Internal.Tip
117 Data.Set.Internal.Tip
118 in let (#
119 farInp,
120 farExp
121 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp cs of
122 GHC.Types.LT ->
123 (#
124 cs,
125 failExp
126 #)
127 GHC.Types.EQ ->
128 (#
129 farInp,
130 failExp GHC.Base.<> farExp
131 #)
132 GHC.Types.GT ->
133 (#
134 farInp,
135 farExp
136 #)
137 in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure cs farInp farExp
138 else
139 let _ = "checkToken.else"
140 in let failExp =
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') -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
146 )
147 )
148 Data.Set.Internal.Tip
149 Data.Set.Internal.Tip
150 in let (#
151 farInp,
152 farExp
153 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
154 GHC.Types.LT ->
155 (#
156 failInp,
157 failExp
158 #)
159 GHC.Types.EQ ->
160 (#
161 farInp,
162 failExp GHC.Base.<> farExp
163 #)
164 GHC.Types.GT ->
165 (#
166 farInp,
167 farExp
168 #)
169 in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp
170 else
171 let _ = "checkHorizon.else"
172 in let failExp =
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') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 2
178 )
179 )
180 Data.Set.Internal.Tip
181 Data.Set.Internal.Tip
182 in let (#
183 farInp,
184 farExp
185 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
186 GHC.Types.LT ->
187 (#
188 failInp,
189 failExp
190 #)
191 GHC.Types.EQ ->
192 (#
193 farInp,
194 failExp GHC.Base.<> farExp
195 #)
196 GHC.Types.GT ->
197 (#
198 farInp,
199 farExp
200 #)
201 in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp
202 else
203 let _ = "choicesBranch.else"
204 in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp
205 in let readFail = catchHandler
206 in if readMore (Symantic.Parser.Machine.Input.shiftRightText 1 init)
207 then
208 let !(# c, cs #) = readNext init
209 in if ('a' GHC.Classes.==) c
210 then
211 let readFail = readFail
212 in let !(# c, cs #) = readNext cs
213 in if ('a' GHC.Classes.==) c
214 then
215 let _ = "resume"
216 in join
217 init
218 Data.Set.Internal.empty
219 ( let _ = "resume.genCode"
220 in 'a' GHC.Types.: ('a' GHC.Types.: GHC.Types . [])
221 )
222 cs
223 else
224 let _ = "checkToken.else"
225 in let failExp =
226 Data.Set.Internal.Bin
227 1
228 ( Symantic.Parser.Grammar.Combinators.SomeFailure
229 ( case inputToken of
230 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
231 )
232 )
233 Data.Set.Internal.Tip
234 Data.Set.Internal.Tip
235 in let (#
236 farInp,
237 farExp
238 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init cs of
239 GHC.Types.LT ->
240 (#
241 cs,
242 failExp
243 #)
244 GHC.Types.EQ ->
245 (#
246 init,
247 failExp GHC.Base.<> Data.Set.Internal.empty
248 #)
249 GHC.Types.GT ->
250 (#
251 init,
252 Data.Set.Internal.empty
253 #)
254 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure cs farInp farExp
255 else
256 let _ = "checkToken.else"
257 in let failExp =
258 Data.Set.Internal.Bin
259 1
260 ( Symantic.Parser.Grammar.Combinators.SomeFailure
261 ( case inputToken of
262 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
263 )
264 )
265 Data.Set.Internal.Tip
266 Data.Set.Internal.Tip
267 in let (#
268 farInp,
269 farExp
270 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init init of
271 GHC.Types.LT ->
272 (#
273 init,
274 failExp
275 #)
276 GHC.Types.EQ ->
277 (#
278 init,
279 failExp GHC.Base.<> Data.Set.Internal.empty
280 #)
281 GHC.Types.GT ->
282 (#
283 init,
284 Data.Set.Internal.empty
285 #)
286 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure init farInp farExp
287 else
288 let _ = "checkHorizon.else"
289 in let failExp =
290 Data.Set.Internal.Bin
291 1
292 ( Symantic.Parser.Grammar.Combinators.SomeFailure
293 ( case inputToken of
294 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 2
295 )
296 )
297 Data.Set.Internal.Tip
298 Data.Set.Internal.Tip
299 in let (#
300 farInp,
301 farExp
302 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init init of
303 GHC.Types.LT ->
304 (#
305 init,
306 failExp
307 #)
308 GHC.Types.EQ ->
309 (#
310 init,
311 failExp GHC.Base.<> Data.Set.Internal.empty
312 #)
313 GHC.Types.GT ->
314 (#
315 init,
316 Data.Set.Internal.empty
317 #)
318 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure init farInp farExp