]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G12.expected.txt
test: add goldens for TH splices
[haskell/symantic-parser.git] / test / Golden / Splice / G12.expected.txt
1 test/Golden/Splice/G12.hs:0:0:: Splicing expression
2 P.runParser @Text Grammar.g12
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 -> if (\ x -> x)
35 (((\ (Data.Text.Internal.Text _ i _)
36 (Data.Text.Internal.Text _ j _)
37 -> (i == j))
38 inp)
39 failInp) then
40 let _ = "resume"
41 in
42 (((ok farInp) farExp) (let _ = "resume.genCode" in \ x -> x))
43 failInp
44 else
45 let
46 (# farInp, farExp #)
47 = case
48 ((compare `Data.Function.on` P.offset) farInp) failInp
49 of
50 LT -> (# failInp, [] #)
51 EQ -> (# farInp, (farExp <> []) #)
52 GT -> (# farInp, farExp #)
53 in
54 (((((Data.Map.Strict.Internal.findWithDefault finalRaise)
55 "fail")
56 koByLabel)
57 failInp)
58 farInp)
59 farExp
60 in
61 if readMore inp then
62 let !(# c, cs #) = readNext inp
63 in
64 if (\ t
65 -> (('a' == t)
66 || (('b' == t) || (('c' == t) || (('d' == t) || False)))))
67 c then
68 let
69 _ = "call exceptionsByName(name_1)=[] catchStackByLabel(ctx)=["fail"]"
70 in
71 ((name
72 (let
73 _ = "suspend raiseException=fromList [(name_1,fromList [])]"
74 in
75 \ farInp farExp v !inp
76 -> let _ = "resume"
77 in
78 (((ok farInp) farExp)
79 (let _ = "resume.genCode"
80 in
81 ((\ x -> \ x -> x x)
82 (((\ x -> \ x -> x x)
83 (\ x -> \ x -> \ x -> (x : x x)))
84 c))
85 v))
86 inp))
87 cs)
88 Data.Map.Internal.Tip
89 else
90 let _ = "checkToken.else" in
91 let
92 (# farInp, farExp #)
93 = case ((compare `Data.Function.on` P.offset) init) inp of
94 LT -> (# inp, [P.ErrorItemLabel "oneOf"] #)
95 EQ -> (# init, ([] <> [P.ErrorItemLabel "oneOf"]) #)
96 GT -> (# init, [] #)
97 in ((readFail inp) farInp) farExp
98 else
99 let _ = "checkHorizon.else" in
100 let
101 (# farInp, farExp #)
102 = case ((compare `Data.Function.on` P.offset) init) inp of
103 LT -> (# inp, [P.ErrorItemHorizon 1] #)
104 EQ -> (# init, ([] <> [P.ErrorItemHorizon 1]) #)
105 GT -> (# init, [] #)
106 in ((readFail inp) farInp) farExp in
107 let
108 _ = "call exceptionsByName(name_1)=["fail"] catchStackByLabel(ctx)=[]"
109 in
110 ((name
111 (let
112 _ = "suspend raiseException=fromList [(name_1,fromList [("fail",())])]"
113 in
114 \ farInp farExp v !inp
115 -> let
116 join
117 = \ farInp farExp v !inp
118 -> let _ = "resume"
119 in
120 (((finalRet farInp) farExp)
121 (let _ = "resume.genCode"
122 in
123 ((\ x -> \ x -> x x)
124 (((\ x -> \ x -> x x) (\ x -> \ x -> x [])) v))
125 v))
126 inp in
127 let _ = ("catchException lbl=" <> "fail") in
128 let _ = ("catchException lbl=" <> "fail") in
129 let
130 readFail
131 = \ !failInp !farInp !farExp
132 -> let _ = "resume"
133 in (((join farInp) farExp) (let _ = "resume.genCode" in ())) inp
134 in
135 if readMore inp then
136 let !(# c, cs #) = readNext inp
137 in
138 if (\ x -> True) c then
139 let
140 (# farInp, farExp #)
141 = case ((compare `Data.Function.on` P.offset) farInp) inp of
142 LT -> (# inp, [] #)
143 EQ -> (# farInp, (farExp <> []) #)
144 GT -> (# farInp, farExp #)
145 in
146 (((\ !failInp !farInp !farExp
147 -> if (\ x -> x)
148 (((\ (Data.Text.Internal.Text _ i _)
149 (Data.Text.Internal.Text _ j _)
150 -> (i == j))
151 inp)
152 failInp) then
153 let
154 (# farInp, farExp #)
155 = case
156 ((compare `Data.Function.on` P.offset)
157 farInp)
158 failInp
159 of
160 LT -> (# failInp, [P.ErrorItemEnd] #)
161 EQ
162 -> (# farInp,
163 (farExp <> [P.ErrorItemEnd]) #)
164 GT -> (# farInp, farExp #)
165 in ((finalRaise failInp) farInp) farExp
166 else
167 let
168 (# farInp, farExp #)
169 = case
170 ((compare `Data.Function.on` P.offset)
171 farInp)
172 failInp
173 of
174 LT -> (# failInp, [] #)
175 EQ -> (# farInp, (farExp <> []) #)
176 GT -> (# farInp, farExp #)
177 in ((finalRaise failInp) farInp) farExp)
178 inp)
179 farInp)
180 farExp
181 else
182 let _ = "checkToken.else" in
183 let
184 (# farInp, farExp #)
185 = case ((compare `Data.Function.on` P.offset) farInp) inp of
186 LT -> (# inp, [] #)
187 EQ -> (# farInp, (farExp <> []) #)
188 GT -> (# farInp, farExp #)
189 in ((readFail inp) farInp) farExp
190 else
191 let _ = "checkHorizon.else" in
192 let
193 (# farInp, farExp #)
194 = case ((compare `Data.Function.on` P.offset) farInp) inp of
195 LT -> (# inp, [P.ErrorItemHorizon 1] #)
196 EQ -> (# farInp, (farExp <> [P.ErrorItemHorizon 1]) #)
197 GT -> (# farInp, farExp #)
198 in ((readFail inp) farInp) farExp))
199 init)
200 Data.Map.Internal.Tip