]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G6.expected.txt
test: add goldens for TH splices
[haskell/symantic-parser.git] / test / Golden / Splice / G6.expected.txt
1 test/Golden/Splice/G6.hs:0:0:: Splicing expression
2 P.runParser @Text Grammar.g6
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 -> if (\ x -> x)
32 (((\ (Data.Text.Internal.Text _ i _)
33 (Data.Text.Internal.Text _ j _)
34 -> (i == j))
35 init)
36 failInp) then
37 let readFail = finalRaise
38 in
39 if readMore ((P.shiftRightText 1) failInp) then
40 let !(# c, cs #) = readNext failInp
41 in
42 if ('a' ==) c then
43 let readFail = finalRaise in
44 let !(# c, cs #) = readNext cs
45 in
46 if ('b' ==) c then
47 let _ = "resume"
48 in
49 (((finalRet farInp) farExp)
50 (let _ = "resume.genCode"
51 in
52 ((\ x -> \ x -> x x)
53 (((\ x -> \ x -> x x)
54 (\ x -> \ x -> ('a' : ('b' : []))))
55 c))
56 c))
57 cs
58 else
59 let _ = "checkToken.else" in
60 let
61 (# farInp, farExp #)
62 = case
63 ((compare `Data.Function.on` P.offset) farInp)
64 cs
65 of
66 LT -> (# cs, [P.ErrorItemToken 'b'] #)
67 EQ
68 -> (# farInp,
69 (farExp <> [P.ErrorItemToken 'b']) #)
70 GT -> (# farInp, farExp #)
71 in ((finalRaise cs) farInp) farExp
72 else
73 let _ = "checkToken.else" in
74 let
75 (# farInp, farExp #)
76 = case
77 ((compare `Data.Function.on` P.offset) farInp) failInp
78 of
79 LT -> (# failInp, [P.ErrorItemToken 'a'] #)
80 EQ -> (# farInp, (farExp <> [P.ErrorItemToken 'a']) #)
81 GT -> (# farInp, farExp #)
82 in ((finalRaise failInp) farInp) farExp
83 else
84 let _ = "checkHorizon.else" in
85 let
86 (# farInp, farExp #)
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
92 else
93 let
94 (# 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
100 in
101 if readMore ((P.shiftRightText 1) init) then
102 let !(# c, cs #) = readNext init
103 in
104 if ('a' ==) c then
105 let readFail = readFail in
106 let !(# c, cs #) = readNext cs
107 in
108 if ('a' ==) c then
109 let _ = "resume"
110 in
111 (((finalRet init) [])
112 (let _ = "resume.genCode"
113 in
114 ((\ x -> \ x -> x x)
115 (((\ x -> \ x -> x x) (\ x -> \ x -> ('a' : ('a' : [])))) c))
116 c))
117 cs
118 else
119 let _ = "checkToken.else" in
120 let
121 (# farInp, farExp #)
122 = case ((compare `Data.Function.on` P.offset) init) cs of
123 LT -> (# cs, [P.ErrorItemToken 'a'] #)
124 EQ -> (# init, ([] <> [P.ErrorItemToken 'a']) #)
125 GT -> (# init, [] #)
126 in ((readFail cs) farInp) farExp
127 else
128 let _ = "checkToken.else" in
129 let
130 (# farInp, farExp #)
131 = case ((compare `Data.Function.on` P.offset) init) init of
132 LT -> (# init, [P.ErrorItemToken 'a'] #)
133 EQ -> (# init, ([] <> [P.ErrorItemToken 'a']) #)
134 GT -> (# init, [] #)
135 in ((readFail init) farInp) farExp
136 else
137 let _ = "checkHorizon.else" in
138 let
139 (# farInp, farExp #)
140 = case ((compare `Data.Function.on` P.offset) init) init of
141 LT -> (# init, [P.ErrorItemHorizon 2] #)
142 EQ -> (# init, ([] <> [P.ErrorItemHorizon 2]) #)
143 GT -> (# init, [] #)
144 in ((readFail init) farInp) farExp