]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G2.expected.txt
test: add goldens for TH splices
[haskell/symantic-parser.git] / test / Golden / Splice / G2.expected.txt
1 test/Golden/Splice/G2.hs:0:0:: Splicing expression
2 P.runParser @Text Grammar.g2
3 ======>
4 \ (input :: inp)
5 -> let
6 !(# init, readMore, readNext #)
7 = let _ = "cursorOf" in
8 let
9 next t@(Data.Text.Internal.Text arr off unconsumed)
10 = let !(Data.Text.Unsafe.Iter c d) = (Data.Text.Unsafe.iter t) 0
11 in
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
16 let
17 finalRaise :: forall b. P.Catcher inp b
18 = \ _failInp !farInp !farExp
19 -> Left
20 P.ParsingErrorStandard
21 {P.parsingErrorOffset = P.offset farInp,
22 P.parsingErrorUnexpected = if readMore farInp then
23 Just (let (# c, _ #) = readNext farInp in c)
24 else
25 Nothing,
26 P.parsingErrorExpecting = Data.Set.Internal.fromList farExp} in
27 let _ = ("catchException lbl=" <> "fail") in
28 let
29 readFail
30 = \ !failInp !farInp !farExp
31 -> let
32 (# farInp, farExp #)
33 = case ((compare `Data.Function.on` P.offset) farInp) init of
34 LT -> (# init, [] #)
35 EQ -> (# farInp, (farExp <> []) #)
36 GT -> (# farInp, farExp #)
37 in ((finalRaise init) farInp) farExp
38 in
39 if readMore ((P.shiftRightText 2) init) then
40 let !(# c, cs #) = readNext init
41 in
42 if ('a' ==) c then
43 let readFail = readFail in
44 let !(# c, cs #) = readNext cs
45 in
46 if ('b' ==) c then
47 let readFail = readFail in
48 let !(# c, cs #) = readNext cs
49 in
50 if ('c' ==) c then
51 let _ = "resume"
52 in
53 (((finalRet init) [])
54 (let _ = "resume.genCode"
55 in
56 ((\ x -> \ x -> x x)
57 (((\ x -> \ x -> x x)
58 (((\ x -> \ x -> x x)
59 (\ x
60 -> \ x -> \ x -> ('a' : ('b' : ('c' : [])))))
61 c))
62 c))
63 c))
64 cs
65 else
66 let _ = "checkToken.else" in
67 let
68 (# farInp, farExp #)
69 = case ((compare `Data.Function.on` P.offset) init) cs of
70 LT -> (# cs, [P.ErrorItemToken 'c'] #)
71 EQ -> (# init, ([] <> [P.ErrorItemToken 'c']) #)
72 GT -> (# init, [] #)
73 in ((readFail cs) farInp) farExp
74 else
75 let _ = "checkToken.else" in
76 let
77 (# farInp, farExp #)
78 = case ((compare `Data.Function.on` P.offset) init) cs of
79 LT -> (# cs, [P.ErrorItemToken 'b'] #)
80 EQ -> (# init, ([] <> [P.ErrorItemToken 'b']) #)
81 GT -> (# init, [] #)
82 in ((readFail cs) farInp) farExp
83 else
84 let _ = "checkToken.else" in
85 let
86 (# farInp, farExp #)
87 = case ((compare `Data.Function.on` P.offset) init) init of
88 LT -> (# init, [P.ErrorItemToken 'a'] #)
89 EQ -> (# init, ([] <> [P.ErrorItemToken 'a']) #)
90 GT -> (# init, [] #)
91 in ((readFail init) farInp) farExp
92 else
93 let _ = "checkHorizon.else" in
94 let
95 (# farInp, farExp #)
96 = case ((compare `Data.Function.on` P.offset) init) init of
97 LT -> (# init, [P.ErrorItemHorizon 3] #)
98 EQ -> (# init, ([] <> [P.ErrorItemHorizon 3]) #)
99 GT -> (# init, [] #)
100 in ((readFail init) farInp) farExp