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