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