1 test/Golden/Splice/G7.hs:0:0:: Splicing expression
2 P.runParser @Text Grammar.g7
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
28 let _ = ("catchException lbl=" <> "fail") in
31 = \ !failInp !farInp !farExp
34 = case ((compare `Data.Function.on` P.offset) farInp) init of
36 EQ -> (# farInp, (farExp <> []) #)
37 GT -> (# farInp, farExp #)
39 (((\ !failInp !farInp !farExp
41 (((\ (Data.Text.Internal.Text _ i _)
42 (Data.Text.Internal.Text _ j _)
46 let _ = ("catchException lbl=" <> "fail") in
49 = \ !failInp !farInp !farExp
53 ((compare `Data.Function.on` P.offset)
57 LT -> (# failInp, [] #)
58 EQ -> (# farInp, (farExp <> []) #)
59 GT -> (# farInp, farExp #)
60 in ((finalRaise failInp) farInp) farExp
62 if readMore ((P.shiftRightText 1) failInp) then
63 let !(# c, cs #) = readNext failInp
66 let readFail = readFail in
67 let !(# c, cs #) = readNext cs
72 (((finalRet farInp) farExp)
73 (let _ = "resume.genCode"
78 -> \ x -> ('a' : ('b' : []))))
83 let _ = "checkToken.else" in
87 ((compare `Data.Function.on` P.offset)
91 LT -> (# cs, [P.ErrorItemToken 'b'] #)
95 <> [P.ErrorItemToken 'b']) #)
96 GT -> (# farInp, farExp #)
97 in ((readFail cs) farInp) farExp
99 let _ = "checkToken.else" in
103 ((compare `Data.Function.on` P.offset)
107 LT -> (# failInp, [P.ErrorItemToken 'a'] #)
110 (farExp <> [P.ErrorItemToken 'a']) #)
111 GT -> (# farInp, farExp #)
112 in ((readFail failInp) farInp) farExp
114 let _ = "checkHorizon.else" in
118 ((compare `Data.Function.on` P.offset) farInp)
121 LT -> (# failInp, [P.ErrorItemHorizon 2] #)
124 (farExp <> [P.ErrorItemHorizon 2]) #)
125 GT -> (# farInp, farExp #)
126 in ((readFail failInp) farInp) farExp
131 ((compare `Data.Function.on` P.offset) farInp) failInp
133 LT -> (# failInp, [] #)
134 EQ -> (# farInp, (farExp <> []) #)
135 GT -> (# farInp, farExp #)
136 in ((finalRaise failInp) farInp) farExp)
141 if readMore ((P.shiftRightText 1) init) then
142 let !(# c, cs #) = readNext init
145 let readFail = readFail in
146 let !(# c, cs #) = readNext cs
151 (((finalRet init) [])
152 (let _ = "resume.genCode"
155 (((\ x -> \ x -> x x) (\ x -> \ x -> ('a' : ('a' : [])))) c))
159 let _ = "checkToken.else" in
162 = case ((compare `Data.Function.on` P.offset) init) cs of
163 LT -> (# cs, [P.ErrorItemToken 'a'] #)
164 EQ -> (# init, ([] <> [P.ErrorItemToken 'a']) #)
166 in ((readFail cs) farInp) farExp
168 let _ = "checkToken.else" in
171 = case ((compare `Data.Function.on` P.offset) init) init of
172 LT -> (# init, [P.ErrorItemToken 'a'] #)
173 EQ -> (# init, ([] <> [P.ErrorItemToken 'a']) #)
175 in ((readFail init) farInp) farExp
177 let _ = "checkHorizon.else" in
180 = case ((compare `Data.Function.on` P.offset) init) init of
181 LT -> (# init, [P.ErrorItemHorizon 2] #)
182 EQ -> (# init, ([] <> [P.ErrorItemHorizon 2]) #)
184 in ((readFail init) farInp) farExp