]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G15.expected.txt
test: dump splices using TH.runQ instead of calling ghc
[haskell/symantic-parser.git] / test / Golden / Splice / G15.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 in let finalRet = \_farInp _farExp v _inp -> Data.Either.Right v
31 in let finalRaise ::
32 forall b.
33 Symantic.Parser.Machine.Generate.Catcher
34 inp
35 b = \_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.parsingErrorUnexpected =
40 if readMore farInp
41 then
42 GHC.Maybe.Just
43 ( let (#
44 c,
45 _
46 #) = readNext farInp
47 in c
48 )
49 else GHC.Maybe.Nothing,
50 Symantic.Parser.Machine.Generate.parsingErrorExpecting = Data.Set.Internal.fromList farExp
51 }
52 in let
53 in let join = \farInp farExp v (!inp) ->
54 let readFail = finalRaise
55 in if readMore inp
56 then
57 let !(#
58 c,
59 cs
60 #) = readNext inp
61 in if ('c' GHC.Classes.==) c
62 then
63 let _ = "resume"
64 in finalRet
65 farInp
66 farExp
67 ( let _ = "resume.genCode"
68 in GHC.Show.show v
69 )
70 cs
71 else
72 let _ = "checkToken.else"
73 in let (#
74 farInp,
75 farExp
76 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp inp of
77 GHC.Types.LT ->
78 (#
79 inp,
80 [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'c']
81 #)
82 GHC.Types.EQ ->
83 (#
84 farInp,
85 farExp GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'c']
86 #)
87 GHC.Types.GT ->
88 (#
89 farInp,
90 farExp
91 #)
92 in finalRaise inp farInp farExp
93 else
94 let _ = "checkHorizon.else"
95 in let (#
96 farInp,
97 farExp
98 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp inp of
99 GHC.Types.LT ->
100 (#
101 inp,
102 [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 1]
103 #)
104 GHC.Types.EQ ->
105 (#
106 farInp,
107 farExp GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 1]
108 #)
109 GHC.Types.GT ->
110 (#
111 farInp,
112 farExp
113 #)
114 in finalRaise inp farInp farExp
115 in let _ = "catchException lbl=fail"
116 in let catchHandler (!failInp) (!farInp) (!farExp) =
117 let _ = "catchException.ko lbl=fail"
118 in if ( \( Data.Text.Internal.Text
119 _
120 i
121 _
122 )
123 ( Data.Text.Internal.Text
124 _
125 j
126 _
127 ) -> i GHC.Classes.== j
128 )
129 init
130 failInp
131 then
132 let _ = "choicesBranch.then"
133 in let readFail = finalRaise
134 in if readMore (Symantic.Parser.Machine.Input.shiftRightText 1 failInp)
135 then
136 let !(#
137 c,
138 cs
139 #) = readNext failInp
140 in if ('b' GHC.Classes.==) c
141 then
142 let _ = "resume"
143 in join
144 farInp
145 farExp
146 ( let _ = "resume.genCode"
147 in 'b'
148 )
149 cs
150 else
151 let _ = "checkToken.else"
152 in let (#
153 farInp,
154 farExp
155 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
156 GHC.Types.LT ->
157 (#
158 failInp,
159 [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'b']
160 #)
161 GHC.Types.EQ ->
162 (#
163 farInp,
164 farExp GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'b']
165 #)
166 GHC.Types.GT ->
167 (#
168 farInp,
169 farExp
170 #)
171 in finalRaise failInp farInp farExp
172 else
173 let _ = "checkHorizon.else"
174 in let (#
175 farInp,
176 farExp
177 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
178 GHC.Types.LT ->
179 (#
180 failInp,
181 [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 2]
182 #)
183 GHC.Types.EQ ->
184 (#
185 farInp,
186 farExp GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 2]
187 #)
188 GHC.Types.GT ->
189 (#
190 farInp,
191 farExp
192 #)
193 in finalRaise failInp farInp farExp
194 else
195 let _ = "choicesBranch.else"
196 in let (#
197 farInp,
198 farExp
199 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
200 GHC.Types.LT ->
201 (#
202 failInp,
203 []
204 #)
205 GHC.Types.EQ ->
206 (#
207 farInp,
208 farExp GHC.Base.<> []
209 #)
210 GHC.Types.GT ->
211 (#
212 farInp,
213 farExp
214 #)
215 in finalRaise failInp farInp farExp
216 in let readFail = catchHandler
217 in if readMore (Symantic.Parser.Machine.Input.shiftRightText 1 init)
218 then
219 let !(# c, cs #) = readNext init
220 in if ('a' GHC.Classes.==) c
221 then
222 let _ = "resume"
223 in join init GHC.Types
224 . []
225 ( let _ = "resume.genCode"
226 in 'a'
227 )
228 cs
229 else
230 let _ = "checkToken.else"
231 in let (#
232 farInp,
233 farExp
234 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init init of
235 GHC.Types.LT ->
236 (#
237 init,
238 [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'a']
239 #)
240 GHC.Types.EQ ->
241 (#
242 init,
243 GHC.Types . [] GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'a']
244 #)
245 GHC.Types.GT ->
246 (#
247 init,
248 GHC.Types . []
249 #)
250 in readFail init farInp farExp
251 else
252 let _ = "checkHorizon.else"
253 in let (#
254 farInp,
255 farExp
256 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init init of
257 GHC.Types.LT ->
258 (#
259 init,
260 [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 2]
261 #)
262 GHC.Types.EQ ->
263 (#
264 init,
265 GHC.Types . [] GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 2]
266 #)
267 GHC.Types.GT ->
268 (#
269 init,
270 GHC.Types . []
271 #)
272 in readFail init farInp farExp