1 test/Golden/Splice/G2.hs:0:0:: Splicing expression
2 P.runParser @Text Grammar.g2
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
27 let _ = ("catchException lbl=" <> "fail") in
30 = \ !failInp !farInp !farExp
33 = case ((compare `Data.Function.on` P.offset) farInp) init of
35 EQ -> (# farInp, (farExp <> []) #)
36 GT -> (# farInp, farExp #)
37 in ((finalRaise init) farInp) farExp
39 if readMore ((P.shiftRightText 2) init) then
40 let !(# c, cs #) = readNext init
43 let readFail = readFail in
44 let !(# c, cs #) = readNext cs
47 let readFail = readFail in
48 let !(# c, cs #) = readNext cs
54 (let _ = "resume.genCode"
60 -> \ x -> \ x -> ('a' : ('b' : ('c' : [])))))
66 let _ = "checkToken.else" in
69 = case ((compare `Data.Function.on` P.offset) init) cs of
70 LT -> (# cs, [P.ErrorItemToken 'c'] #)
71 EQ -> (# init, ([] <> [P.ErrorItemToken 'c']) #)
73 in ((readFail cs) farInp) farExp
75 let _ = "checkToken.else" in
78 = case ((compare `Data.Function.on` P.offset) init) cs of
79 LT -> (# cs, [P.ErrorItemToken 'b'] #)
80 EQ -> (# init, ([] <> [P.ErrorItemToken 'b']) #)
82 in ((readFail cs) farInp) farExp
84 let _ = "checkToken.else" in
87 = case ((compare `Data.Function.on` P.offset) init) init of
88 LT -> (# init, [P.ErrorItemToken 'a'] #)
89 EQ -> (# init, ([] <> [P.ErrorItemToken 'a']) #)
91 in ((readFail init) farInp) farExp
93 let _ = "checkHorizon.else" in
96 = case ((compare `Data.Function.on` P.offset) init) init of
97 LT -> (# init, [P.ErrorItemHorizon 3] #)
98 EQ -> (# init, ([] <> [P.ErrorItemHorizon 3]) #)
100 in ((readFail init) farInp) farExp