1 test/Golden/Splice/G4.hs:0:0:: Splicing expression
2 P.runParser @Text Grammar.g4
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.Bin 1) "fail")
184 (\ !failInp !farInp !farExp
186 (((\ (Data.Text.Internal.Text _
189 (Data.Text.Internal.Text _
197 (((ok farInp) farExp)
198 (let _ = "resume.genCode"
211 LT -> (# failInp, [] #)
216 -> (# farInp, farExp #)
218 (((((Data.Map.Strict.Internal.findWithDefault
225 Data.Map.Internal.Tip)
226 Data.Map.Internal.Tip)))
228 (((((Data.Map.Internal.Bin 1) "fail")
229 (\ !failInp !farInp !farExp
231 (((\ (Data.Text.Internal.Text _ i _)
232 (Data.Text.Internal.Text _ j _)
238 (((ok farInp) farExp)
239 (let _ = "resume.genCode" in \ x -> x))
246 `Data.Function.on` P.offset)
250 LT -> (# failInp, [] #)
251 EQ -> (# farInp, (farExp <> []) #)
252 GT -> (# farInp, farExp #)
254 (((((Data.Map.Strict.Internal.findWithDefault
261 Data.Map.Internal.Tip)
262 Data.Map.Internal.Tip) in
264 _ = "call exceptionsByName(name_2)=["fail"] catchStackByLabel(ctx)=[]"
268 _ = "suspend raiseException=fromList [(name_1,fromList [("fail",())]),(name_2,fromList [("fail",())])]"
270 \ farInp farExp v !inp
273 (((finalRet farInp) farExp)
274 (let _ = "resume.genCode"
277 (((\ x -> \ x -> x x) (\ x -> \ x -> (x : x [])))
282 Data.Map.Internal.Tip))
284 Data.Map.Internal.Tip