]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G12.expected.txt
bug: a ref outside its def must be supported
[haskell/symantic-parser.git] / test / Golden / Splice / G12.expected.txt
1 test/Golden/Splice/G12.hs:0:0:: Splicing expression
2 P.runParser @Text Grammar.g12
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
28 name
29 = \ !ok !inp !koByLabel
30 -> let _ = "catchException lbl=fail" in
31 let
32 readFail
33 = \ !failInp !farInp !farExp
34 -> if (\ x -> x)
35 (((\ (Data.Text.Internal.Text _ i _)
36 (Data.Text.Internal.Text _ j _)
37 -> (i == j))
38 inp)
39 failInp) then
40 let _ = "resume"
41 in
42 (((ok farInp) farExp) (let _ = "resume.genCode" in \ x -> x))
43 failInp
44 else
45 let
46 (# farInp, farExp #)
47 = case
48 ((compare `Data.Function.on` P.offset) farInp) failInp
49 of
50 LT -> (# failInp, [] #)
51 EQ -> (# farInp, (farExp <> []) #)
52 GT -> (# farInp, farExp #)
53 in
54 (((((Data.Map.Strict.Internal.findWithDefault finalRaise)
55 "fail")
56 koByLabel)
57 failInp)
58 farInp)
59 farExp
60 in
61 if readMore inp then
62 let !(# c, cs #) = readNext inp
63 in
64 if (\ t
65 -> (('a' == t)
66 || (('b' == t) || (('c' == t) || (('d' == t) || False)))))
67 c then
68 let
69 _ = "call exceptionsByName(name_1)=[] catchStackByLabel(ctx)=["fail"]"
70 in
71 ((name
72 (let
73 _ = "suspend raiseException=fromList [(name_1,fromList [])]"
74 in
75 \ farInp farExp v !inp
76 -> let _ = "resume"
77 in
78 (((ok farInp) farExp)
79 (let _ = "resume.genCode"
80 in
81 ((\ x -> \ x -> x x)
82 (((\ x -> \ x -> x x)
83 (\ x -> \ x -> \ x -> (x : x x)))
84 c))
85 v))
86 inp))
87 cs)
88 (((((Data.Map.Internal.Bin 1) "fail") readFail)
89 Data.Map.Internal.Tip)
90 Data.Map.Internal.Tip)
91 else
92 let _ = "checkToken.else" in
93 let
94 (# farInp, farExp #)
95 = case ((compare `Data.Function.on` P.offset) init) inp of
96 LT -> (# inp, [P.ErrorItemLabel "oneOf"] #)
97 EQ -> (# init, ([] <> [P.ErrorItemLabel "oneOf"]) #)
98 GT -> (# init, [] #)
99 in ((readFail inp) farInp) farExp
100 else
101 let _ = "checkHorizon.else" in
102 let
103 (# farInp, farExp #)
104 = case ((compare `Data.Function.on` P.offset) init) inp of
105 LT -> (# inp, [P.ErrorItemHorizon 1] #)
106 EQ -> (# init, ([] <> [P.ErrorItemHorizon 1]) #)
107 GT -> (# init, [] #)
108 in ((readFail inp) farInp) farExp in
109 let
110 _ = "call exceptionsByName(name_1)=["fail"] catchStackByLabel(ctx)=[]"
111 in
112 ((name
113 (let
114 _ = "suspend raiseException=fromList [(name_1,fromList [("fail",())])]"
115 in
116 \ farInp farExp v !inp
117 -> let
118 join
119 = \ farInp farExp v !inp
120 -> let _ = "resume"
121 in
122 (((finalRet farInp) farExp)
123 (let _ = "resume.genCode"
124 in
125 ((\ x -> \ x -> x x)
126 (((\ x -> \ x -> x x) (\ x -> \ x -> x [])) v))
127 v))
128 inp in
129 let _ = "catchException lbl=fail" in
130 let _ = "catchException lbl=fail" in
131 let
132 readFail
133 = \ !failInp !farInp !farExp
134 -> let _ = "resume"
135 in (((join farInp) farExp) (let _ = "resume.genCode" in ())) inp
136 in
137 if readMore inp then
138 let !(# c, cs #) = readNext inp
139 in
140 if (\ x -> True) c then
141 let
142 (# farInp, farExp #)
143 = case ((compare `Data.Function.on` P.offset) farInp) inp of
144 LT -> (# inp, [] #)
145 EQ -> (# farInp, (farExp <> []) #)
146 GT -> (# farInp, farExp #)
147 in
148 (((\ !failInp !farInp !farExp
149 -> if (\ x -> x)
150 (((\ (Data.Text.Internal.Text _ i _)
151 (Data.Text.Internal.Text _ j _)
152 -> (i == j))
153 inp)
154 failInp) then
155 let
156 (# farInp, farExp #)
157 = case
158 ((compare `Data.Function.on` P.offset)
159 farInp)
160 failInp
161 of
162 LT -> (# failInp, [P.ErrorItemEnd] #)
163 EQ
164 -> (# farInp,
165 (farExp <> [P.ErrorItemEnd]) #)
166 GT -> (# farInp, farExp #)
167 in ((finalRaise failInp) farInp) farExp
168 else
169 let
170 (# farInp, farExp #)
171 = case
172 ((compare `Data.Function.on` P.offset)
173 farInp)
174 failInp
175 of
176 LT -> (# failInp, [] #)
177 EQ -> (# farInp, (farExp <> []) #)
178 GT -> (# farInp, farExp #)
179 in ((finalRaise failInp) farInp) farExp)
180 inp)
181 farInp)
182 farExp
183 else
184 let _ = "checkToken.else" in
185 let
186 (# farInp, farExp #)
187 = case ((compare `Data.Function.on` P.offset) farInp) inp of
188 LT -> (# inp, [] #)
189 EQ -> (# farInp, (farExp <> []) #)
190 GT -> (# farInp, farExp #)
191 in ((readFail inp) farInp) farExp
192 else
193 let _ = "checkHorizon.else" in
194 let
195 (# farInp, farExp #)
196 = case ((compare `Data.Function.on` P.offset) farInp) inp of
197 LT -> (# inp, [P.ErrorItemHorizon 1] #)
198 EQ -> (# farInp, (farExp <> [P.ErrorItemHorizon 1]) #)
199 GT -> (# farInp, farExp #)
200 in ((readFail inp) farInp) farExp))
201 init)
202 Data.Map.Internal.Tip