1 test/Golden/Splice/G6.hs:0:0:: Splicing expression
2 P.runParser @Text Grammar.g6
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
32 (((\ (Data.Text.Internal.Text _ i _)
33 (Data.Text.Internal.Text _ j _)
37 let readFail = finalRaise
39 if readMore ((P.shiftRightText 1) failInp) then
40 let !(# c, cs #) = readNext failInp
43 let readFail = finalRaise in
44 let !(# c, cs #) = readNext cs
49 (((finalRet farInp) farExp)
50 (let _ = "resume.genCode"
54 (\ x -> \ x -> ('a' : ('b' : []))))
59 let _ = "checkToken.else" in
63 ((compare `Data.Function.on` P.offset) farInp)
66 LT -> (# cs, [P.ErrorItemToken 'b'] #)
69 (farExp <> [P.ErrorItemToken 'b']) #)
70 GT -> (# farInp, farExp #)
71 in ((finalRaise cs) farInp) farExp
73 let _ = "checkToken.else" in
77 ((compare `Data.Function.on` P.offset) farInp) failInp
79 LT -> (# failInp, [P.ErrorItemToken 'a'] #)
80 EQ -> (# farInp, (farExp <> [P.ErrorItemToken 'a']) #)
81 GT -> (# farInp, farExp #)
82 in ((finalRaise failInp) farInp) farExp
84 let _ = "checkHorizon.else" in
87 = case ((compare `Data.Function.on` P.offset) farInp) failInp of
88 LT -> (# failInp, [P.ErrorItemHorizon 2] #)
89 EQ -> (# farInp, (farExp <> [P.ErrorItemHorizon 2]) #)
90 GT -> (# farInp, farExp #)
91 in ((finalRaise failInp) farInp) farExp
95 = case ((compare `Data.Function.on` P.offset) farInp) failInp of
96 LT -> (# failInp, [] #)
97 EQ -> (# farInp, (farExp <> []) #)
98 GT -> (# farInp, farExp #)
99 in ((finalRaise failInp) farInp) farExp
101 if readMore ((P.shiftRightText 1) init) then
102 let !(# c, cs #) = readNext init
105 let readFail = readFail in
106 let !(# c, cs #) = readNext cs
111 (((finalRet init) [])
112 (let _ = "resume.genCode"
115 (((\ x -> \ x -> x x) (\ x -> \ x -> ('a' : ('a' : [])))) c))
119 let _ = "checkToken.else" in
122 = case ((compare `Data.Function.on` P.offset) init) cs of
123 LT -> (# cs, [P.ErrorItemToken 'a'] #)
124 EQ -> (# init, ([] <> [P.ErrorItemToken 'a']) #)
126 in ((readFail cs) farInp) farExp
128 let _ = "checkToken.else" in
131 = case ((compare `Data.Function.on` P.offset) init) init of
132 LT -> (# init, [P.ErrorItemToken 'a'] #)
133 EQ -> (# init, ([] <> [P.ErrorItemToken 'a']) #)
135 in ((readFail init) farInp) farExp
137 let _ = "checkHorizon.else" in
140 = case ((compare `Data.Function.on` P.offset) init) init of
141 LT -> (# init, [P.ErrorItemHorizon 2] #)
142 EQ -> (# init, ([] <> [P.ErrorItemHorizon 2]) #)
144 in ((readFail init) farInp) farExp