]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G12.expected.txt
bump version
[haskell/symantic-parser.git] / test / Golden / Splice / G12.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 name = \(!ok) (!inp) (!koByLabel) ->
55 let _ = "catch ExceptionFailure"
56 in let catchHandler (!_exn) (!failInp) (!farInp) (!farExp) =
57 let _ = "catch.ko ExceptionFailure"
58 in if ( \( Data.Text.Internal.Text
59 _
60 i
61 _
62 )
63 ( Data.Text.Internal.Text
64 _
65 j
66 _
67 ) -> i GHC.Classes.== j
68 )
69 inp
70 failInp
71 then
72 let _ = "choicesBranch.then"
73 in let _ = "resume"
74 in ok
75 farInp
76 farExp
77 ( let _ = "resume.genCode"
78 in \x -> x
79 )
80 failInp
81 else
82 let _ = "choicesBranch.else"
83 in Data.Map.Strict.Internal.findWithDefault finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure koByLabel Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp
84 in let readFail = catchHandler
85 in if readMore inp
86 then
87 let !(#
88 c,
89 cs
90 #) = readNext inp
91 in if (\t -> ('a' GHC.Classes.== t) GHC.Classes.|| (('b' GHC.Classes.== t) GHC.Classes.|| (('c' GHC.Classes.== t) GHC.Classes.|| (('d' GHC.Classes.== t) GHC.Classes.|| GHC.Types.False)))) c
92 then
93 name
94 ( let _ = "suspend"
95 in \farInp farExp v (!inp) ->
96 let _ = "resume"
97 in ok
98 farInp
99 farExp
100 ( let _ = "resume.genCode"
101 in \x -> (GHC.Types.:) c (v x)
102 )
103 inp
104 )
105 cs
106 (Data.Map.Internal.Bin 1 Symantic.Parser.Grammar.Combinators.ExceptionFailure readFail Data.Map.Internal.Tip Data.Map.Internal.Tip)
107 else
108 let _ = "checkToken.else"
109 in let failExp =
110 Data.Set.Internal.Bin
111 1
112 ( Symantic.Parser.Grammar.Combinators.SomeFailure
113 ( case inputToken of
114 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'd'
115 )
116 )
117 Data.Set.Internal.Tip
118 Data.Set.Internal.Tip
119 in let (#
120 farInp,
121 farExp
122 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init inp of
123 GHC.Types.LT ->
124 (#
125 inp,
126 failExp
127 #)
128 GHC.Types.EQ ->
129 (#
130 init,
131 failExp GHC.Base.<> Data.Set.Internal.empty
132 #)
133 GHC.Types.GT ->
134 (#
135 init,
136 Data.Set.Internal.empty
137 #)
138 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure inp farInp farExp
139 else
140 let _ = "checkHorizon.else"
141 in let failExp =
142 Data.Set.Internal.Bin
143 1
144 ( Symantic.Parser.Grammar.Combinators.SomeFailure
145 ( case inputToken of
146 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
147 )
148 )
149 Data.Set.Internal.Tip
150 Data.Set.Internal.Tip
151 in let (#
152 farInp,
153 farExp
154 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init inp of
155 GHC.Types.LT ->
156 (#
157 inp,
158 failExp
159 #)
160 GHC.Types.EQ ->
161 (#
162 init,
163 failExp GHC.Base.<> Data.Set.Internal.empty
164 #)
165 GHC.Types.GT ->
166 (#
167 init,
168 Data.Set.Internal.empty
169 #)
170 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure inp farInp farExp
171 in name
172 ( let _ = "suspend"
173 in \farInp farExp v (!inp) ->
174 let join = \farInp farExp v (!inp) ->
175 let _ = "resume"
176 in finalRet
177 farInp
178 farExp
179 ( let _ = "resume.genCode"
180 in GHC.Show.show (v GHC.Types . [])
181 )
182 inp
183 in let _ = "catch ExceptionFailure"
184 in let catchHandler (!_exn) (!failInp) (!farInp) (!farExp) =
185 let _ = "catch.ko ExceptionFailure"
186 in if ( \( Data.Text.Internal.Text
187 _
188 i
189 _
190 )
191 ( Data.Text.Internal.Text
192 _
193 j
194 _
195 ) -> i GHC.Classes.== j
196 )
197 inp
198 failInp
199 then
200 let _ = "choicesBranch.then"
201 in let failExp = Data.Set.Internal.Bin 1 (Symantic.Parser.Grammar.Combinators.SomeFailure Symantic.Parser.Grammar.Combinators.FailureEnd) Data.Set.Internal.Tip Data.Set.Internal.Tip
202 in let (#
203 farInp,
204 farExp
205 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
206 GHC.Types.LT ->
207 (#
208 failInp,
209 failExp
210 #)
211 GHC.Types.EQ ->
212 (#
213 farInp,
214 failExp GHC.Base.<> farExp
215 #)
216 GHC.Types.GT ->
217 (#
218 farInp,
219 farExp
220 #)
221 in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp
222 else
223 let _ = "choicesBranch.else"
224 in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp
225 in let _ = "catch ExceptionFailure"
226 in let catchHandler (!_exn) (!failInp) (!farInp) (!farExp) =
227 let _ = "catch.ko ExceptionFailure"
228 in let _ = "resume"
229 in join
230 farInp
231 farExp
232 ( let _ = "resume.genCode"
233 in GHC.Tuple . ()
234 )
235 inp
236 in let readFail = catchHandler
237 in if readMore inp
238 then
239 let !(#
240 c,
241 cs
242 #) = readNext inp
243 in catchHandler Symantic.Parser.Grammar.Combinators.ExceptionFailure inp farInp farExp
244 else
245 let _ = "checkHorizon.else"
246 in let failExp =
247 Data.Set.Internal.Bin
248 1
249 ( Symantic.Parser.Grammar.Combinators.SomeFailure
250 ( case inputToken of
251 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
252 )
253 )
254 Data.Set.Internal.Tip
255 Data.Set.Internal.Tip
256 in let (#
257 farInp,
258 farExp
259 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp inp of
260 GHC.Types.LT ->
261 (#
262 inp,
263 failExp
264 #)
265 GHC.Types.EQ ->
266 (#
267 farInp,
268 failExp GHC.Base.<> farExp
269 #)
270 GHC.Types.GT ->
271 (#
272 farInp,
273 farExp
274 #)
275 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure inp farInp farExp
276 )
277 init
278 Data.Map.Internal.Tip