]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G4.expected.txt
test: add goldens for TH splices
[haskell/symantic-parser.git] / test / Golden / Splice / G4.expected.txt
1 test/Golden/Splice/G4.hs:0:0:: Splicing expression
2 P.runParser @Text Grammar.g4
3 ======>
4 \ (input :: inp)
5 -> let
6 !(# init, readMore, readNext #)
7 = let _ = "cursorOf" in
8 let
9 next t@(Data.Text.Internal.Text arr off unconsumed)
10 = let !(Data.Text.Unsafe.Iter c d) = (Data.Text.Unsafe.iter t) 0
11 in
12 (# c, ((Data.Text.Internal.Text arr) (off + d)) (unconsumed - d) #)
13 more (Data.Text.Internal.Text _ _ unconsumed) = (unconsumed > 0)
14 in (# input, more, next #) in
15 let finalRet = \ _farInp _farExp v _inp -> Right v in
16 let
17 finalRaise :: forall b. P.Catcher inp b
18 = \ _failInp !farInp !farExp
19 -> Left
20 P.ParsingErrorStandard
21 {P.parsingErrorOffset = P.offset farInp,
22 P.parsingErrorUnexpected = if readMore farInp then
23 Just (let (# c, _ #) = readNext farInp in c)
24 else
25 Nothing,
26 P.parsingErrorExpecting = Data.Set.Internal.fromList farExp} in
27 let
28 name
29 = \ !ok !inp !koByLabel
30 -> let _ = ("catchException lbl=" <> "fail") in
31 let
32 readFail
33 = \ !failInp !farInp !farExp
34 -> let
35 (# farInp, farExp #)
36 = case ((compare `Data.Function.on` P.offset) farInp) inp of
37 LT -> (# inp, [] #)
38 EQ -> (# farInp, (farExp <> []) #)
39 GT -> (# farInp, farExp #)
40 in
41 (((((Data.Map.Strict.Internal.findWithDefault finalRaise) "fail")
42 koByLabel)
43 inp)
44 farInp)
45 farExp
46 in
47 if readMore ((P.shiftRightText 3) inp) then
48 let !(# c, cs #) = readNext inp
49 in
50 if ('a' ==) c then
51 let readFail = readFail in
52 let !(# c, cs #) = readNext cs
53 in
54 if ('b' ==) c then
55 let readFail = readFail in
56 let !(# c, cs #) = readNext cs
57 in
58 if ('c' ==) c then
59 let readFail = readFail in
60 let !(# c, cs #) = readNext cs
61 in
62 if ('d' ==) c then
63 let _ = "resume"
64 in
65 (((ok init) [])
66 (let _ = "resume.genCode"
67 in
68 ((\ x -> \ x -> x x)
69 (((\ x -> \ x -> x x)
70 (((\ x -> \ x -> x x)
71 (((\ x -> \ x -> x x)
72 (\ x
73 -> \ x
74 -> \ x
75 -> \ x
76 -> ('a'
77 : ('b'
78 : ('c'
79 : ('d'
80 : []))))))
81 c))
82 c))
83 c))
84 c))
85 cs
86 else
87 let _ = "checkToken.else" in
88 let
89 (# farInp, farExp #)
90 = case
91 ((compare `Data.Function.on` P.offset)
92 init)
93 cs
94 of
95 LT -> (# cs, [P.ErrorItemToken 'd'] #)
96 EQ
97 -> (# init,
98 ([] <> [P.ErrorItemToken 'd']) #)
99 GT -> (# init, [] #)
100 in ((readFail cs) farInp) farExp
101 else
102 let _ = "checkToken.else" in
103 let
104 (# farInp, farExp #)
105 = case
106 ((compare `Data.Function.on` P.offset) init)
107 cs
108 of
109 LT -> (# cs, [P.ErrorItemToken 'c'] #)
110 EQ -> (# init, ([] <> [P.ErrorItemToken 'c']) #)
111 GT -> (# init, [] #)
112 in ((readFail cs) farInp) farExp
113 else
114 let _ = "checkToken.else" in
115 let
116 (# farInp, farExp #)
117 = case ((compare `Data.Function.on` P.offset) init) cs of
118 LT -> (# cs, [P.ErrorItemToken 'b'] #)
119 EQ -> (# init, ([] <> [P.ErrorItemToken 'b']) #)
120 GT -> (# init, [] #)
121 in ((readFail cs) farInp) farExp
122 else
123 let _ = "checkToken.else" in
124 let
125 (# farInp, farExp #)
126 = case ((compare `Data.Function.on` P.offset) init) inp of
127 LT -> (# inp, [P.ErrorItemToken 'a'] #)
128 EQ -> (# init, ([] <> [P.ErrorItemToken 'a']) #)
129 GT -> (# init, [] #)
130 in ((readFail inp) farInp) farExp
131 else
132 let _ = "checkHorizon.else" in
133 let
134 (# farInp, farExp #)
135 = case ((compare `Data.Function.on` P.offset) init) inp of
136 LT -> (# inp, [P.ErrorItemHorizon 4] #)
137 EQ -> (# init, ([] <> [P.ErrorItemHorizon 4]) #)
138 GT -> (# init, [] #)
139 in ((readFail inp) farInp) farExp in
140 let
141 _ = "call exceptionsByName(name_1)=["fail"] catchStackByLabel(ctx)=[]"
142 in
143 ((name
144 (let
145 _ = "suspend raiseException=fromList [(name_1,fromList [("fail",())])]"
146 in
147 \ farInp farExp v !inp
148 -> let
149 name
150 = \ !ok !inp !koByLabel
151 -> let _ = ("catchException lbl=" <> "fail") in
152 let
153 _ = "call exceptionsByName(name_1)=["fail"] catchStackByLabel(ctx)=["fail"]"
154 in
155 ((name
156 (let
157 _ = "suspend raiseException=fromList [(name_1,fromList [("fail",())]),(name_2,fromList [])]"
158 in
159 \ farInp farExp v !inp
160 -> let
161 _ = "call exceptionsByName(name_2)=[] catchStackByLabel(ctx)=["fail"]"
162 in
163 ((name
164 (let
165 _ = "suspend raiseException=fromList [(name_1,fromList [("fail",())]),(name_2,fromList [])]"
166 in
167 \ farInp farExp v !inp
168 -> let _ = "resume"
169 in
170 (((ok farInp) farExp)
171 (let _ = "resume.genCode"
172 in
173 ((\ x -> \ x -> x x)
174 (((\ x -> \ x -> x x)
175 (\ x
176 -> \ x
177 -> \ x
178 -> (x : x x)))
179 v))
180 v))
181 inp))
182 inp)
183 Data.Map.Internal.Tip))
184 inp)
185 (((((Data.Map.Internal.Bin 1) "fail")
186 (\ !failInp !farInp !farExp
187 -> if (\ x -> x)
188 (((\ (Data.Text.Internal.Text _ i _)
189 (Data.Text.Internal.Text _ j _)
190 -> (i == j))
191 inp)
192 failInp) then
193 let _ = "resume"
194 in
195 (((ok farInp) farExp)
196 (let _ = "resume.genCode" in \ x -> x))
197 failInp
198 else
199 let
200 (# farInp, farExp #)
201 = case
202 ((compare
203 `Data.Function.on` P.offset)
204 farInp)
205 failInp
206 of
207 LT -> (# failInp, [] #)
208 EQ -> (# farInp, (farExp <> []) #)
209 GT -> (# farInp, farExp #)
210 in
211 (((((Data.Map.Strict.Internal.findWithDefault
212 finalRaise)
213 "fail")
214 koByLabel)
215 failInp)
216 farInp)
217 farExp))
218 Data.Map.Internal.Tip)
219 Data.Map.Internal.Tip) in
220 let
221 _ = "call exceptionsByName(name_2)=["fail"] catchStackByLabel(ctx)=[]"
222 in
223 ((name
224 (let
225 _ = "suspend raiseException=fromList [(name_1,fromList [("fail",())]),(name_2,fromList [("fail",())])]"
226 in
227 \ farInp farExp v !inp
228 -> let _ = "resume"
229 in
230 (((finalRet farInp) farExp)
231 (let _ = "resume.genCode"
232 in
233 ((\ x -> \ x -> x x)
234 (((\ x -> \ x -> x x) (\ x -> \ x -> (x : x [])))
235 v))
236 v))
237 inp))
238 inp)
239 Data.Map.Internal.Tip))
240 init)
241 Data.Map.Internal.Tip