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