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