1 test/Golden/Splice/G5.hs:0:0:: Splicing expression
2 P.runParser @Text Grammar.g5
6 !(# init, readMore, readNext #)
7 = let _ = "cursorOf" in
9 next t@(Data.Text.Internal.Text arr off unconsumed)
10 = let !(Data.Text.Unsafe.Iter c d) = (Data.Text.Unsafe.iter t) 0
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
17 finalRaise :: forall b. P.Catcher inp b
18 = \ _failInp !farInp !farExp
20 P.ParsingErrorStandard
21 {P.parsingErrorOffset = P.offset farInp,
22 P.parsingErrorUnexpected = if readMore farInp then
23 Just (let (# c, _ #) = readNext farInp in c)
26 P.parsingErrorExpecting = Data.Set.Internal.fromList farExp} in
29 = \ !ok !inp !koByLabel
30 -> let _ = ("catchException lbl=" <> "fail") in
33 = \ !failInp !farInp !farExp
36 = case ((compare `Data.Function.on` P.offset) farInp) inp of
38 EQ -> (# farInp, (farExp <> []) #)
39 GT -> (# farInp, farExp #)
41 (((((Data.Map.Strict.Internal.findWithDefault finalRaise) "fail")
47 if readMore ((P.shiftRightText 3) inp) then
48 let !(# c, cs #) = readNext inp
51 let readFail = readFail in
52 let !(# c, cs #) = readNext cs
55 let readFail = readFail in
56 let !(# c, cs #) = readNext cs
59 let readFail = readFail in
60 let !(# c, cs #) = readNext cs
66 (let _ = "resume.genCode"
87 let _ = "checkToken.else" in
91 ((compare `Data.Function.on` P.offset)
95 LT -> (# cs, [P.ErrorItemToken 'd'] #)
98 ([] <> [P.ErrorItemToken 'd']) #)
100 in ((readFail cs) farInp) farExp
102 let _ = "checkToken.else" in
106 ((compare `Data.Function.on` P.offset) init)
109 LT -> (# cs, [P.ErrorItemToken 'c'] #)
110 EQ -> (# init, ([] <> [P.ErrorItemToken 'c']) #)
112 in ((readFail cs) farInp) farExp
114 let _ = "checkToken.else" in
117 = case ((compare `Data.Function.on` P.offset) init) cs of
118 LT -> (# cs, [P.ErrorItemToken 'b'] #)
119 EQ -> (# init, ([] <> [P.ErrorItemToken 'b']) #)
121 in ((readFail cs) farInp) farExp
123 let _ = "checkToken.else" in
126 = case ((compare `Data.Function.on` P.offset) init) inp of
127 LT -> (# inp, [P.ErrorItemToken 'a'] #)
128 EQ -> (# init, ([] <> [P.ErrorItemToken 'a']) #)
130 in ((readFail inp) farInp) farExp
132 let _ = "checkHorizon.else" in
135 = case ((compare `Data.Function.on` P.offset) init) inp of
136 LT -> (# inp, [P.ErrorItemHorizon 4] #)
137 EQ -> (# init, ([] <> [P.ErrorItemHorizon 4]) #)
139 in ((readFail inp) farInp) farExp in
141 _ = "call exceptionsByName(name_1)=["fail"] catchStackByLabel(ctx)=[]"
145 _ = "suspend raiseException=fromList [(name_1,fromList [("fail",())])]"
147 \ farInp farExp v !inp
150 = \ !ok !inp !koByLabel
151 -> let _ = ("catchException lbl=" <> "fail") in
153 _ = "call exceptionsByName(name_1)=["fail"] catchStackByLabel(ctx)=["fail"]"
157 _ = "suspend raiseException=fromList [(name_1,fromList [("fail",())]),(name_2,fromList [])]"
159 \ farInp farExp v !inp
161 _ = "call exceptionsByName(name_2)=[] catchStackByLabel(ctx)=["fail"]"
165 _ = "suspend raiseException=fromList [(name_1,fromList [("fail",())]),(name_2,fromList [])]"
167 \ farInp farExp v !inp
170 (((ok farInp) farExp)
171 (let _ = "resume.genCode"
174 (((\ x -> \ x -> x x)
183 Data.Map.Internal.Tip))
185 (((((Data.Map.Internal.Bin 1) "fail")
186 (\ !failInp !farInp !farExp
188 (((\ (Data.Text.Internal.Text _ i _)
189 (Data.Text.Internal.Text _ j _)
195 (((ok farInp) farExp)
196 (let _ = "resume.genCode" in \ x -> x))
203 `Data.Function.on` P.offset)
207 LT -> (# failInp, [] #)
208 EQ -> (# farInp, (farExp <> []) #)
209 GT -> (# farInp, farExp #)
211 (((((Data.Map.Strict.Internal.findWithDefault
218 Data.Map.Internal.Tip)
219 Data.Map.Internal.Tip) in
221 _ = "call exceptionsByName(name_2)=["fail"] catchStackByLabel(ctx)=[]"
225 _ = "suspend raiseException=fromList [(name_1,fromList [("fail",())]),(name_2,fromList [("fail",())])]"
227 \ farInp farExp v !inp
230 = \ farInp farExp v !inp
233 (((finalRet farInp) farExp)
234 (let _ = "resume.genCode"
237 (((\ x -> \ x -> x x)
238 (((\ x -> \ x -> x x)
240 -> \ x -> \ x -> (x : x [])))
245 let _ = ("catchException lbl=" <> "fail") in
246 let _ = ("catchException lbl=" <> "fail") in
249 = \ !failInp !farInp !farExp
252 (((join farInp) farExp)
253 (let _ = "resume.genCode" in ()))
257 let !(# c, cs #) = readNext inp
259 if (\ x -> True) c then
263 ((compare `Data.Function.on` P.offset)
268 EQ -> (# farInp, (farExp <> []) #)
269 GT -> (# farInp, farExp #)
271 (((\ !failInp !farInp !farExp
273 (((\ (Data.Text.Internal.Text _ i _)
274 (Data.Text.Internal.Text _ j _)
295 GT -> (# farInp, farExp #)
297 ((finalRaise failInp) farInp)
309 LT -> (# failInp, [] #)
313 GT -> (# farInp, farExp #)
315 ((finalRaise failInp) farInp)
321 let _ = "checkToken.else" in
325 ((compare `Data.Function.on` P.offset)
330 EQ -> (# farInp, (farExp <> []) #)
331 GT -> (# farInp, farExp #)
332 in ((readFail inp) farInp) farExp
334 let _ = "checkHorizon.else" in
338 ((compare `Data.Function.on` P.offset) farInp)
341 LT -> (# inp, [P.ErrorItemHorizon 1] #)
344 (farExp <> [P.ErrorItemHorizon 1]) #)
345 GT -> (# farInp, farExp #)
346 in ((readFail inp) farInp) farExp))
348 Data.Map.Internal.Tip))
350 Data.Map.Internal.Tip