]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G8.expected.txt
change ShowLetName into HideableName
[haskell/symantic-parser.git] / test / Golden / Splice / G8.expected.txt
1 \(input :: inp) ->
2 let !(#
3 init,
4 readMore,
5 readNext
6 #) =
7 let _ = "cursorOf"
8 in let next
9 ( t@( Data.Text.Internal.Text
10 arr
11 off
12 unconsumed
13 )
14 ) =
15 let !( Data.Text.Unsafe.Iter
16 c
17 d
18 ) = Data.Text.Unsafe.iter t 0
19 in (#
20 c,
21 Data.Text.Internal.Text arr (off GHC.Num.+ d) (unconsumed GHC.Num.- d)
22 #)
23 more
24 ( Data.Text.Internal.Text
25 _
26 _
27 unconsumed
28 ) = unconsumed GHC.Classes.> 0
29 in (# input, more, next #)
30 finalRet = \_farInp _farExp v _inp -> Symantic.Parser.Machine.Generate.returnST GHC.Base.$ Data.Either.Right v
31 finalRaise ::
32 forall st b.
33 Symantic.Parser.Machine.Generate.Catcher
34 st
35 inp
36 b = \(!exn) _failInp (!farInp) (!farExp) ->
37 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
38 Data.Either.Left
39 Symantic.Parser.Machine.Generate.ParsingError
40 { Symantic.Parser.Machine.Generate.parsingErrorOffset = Symantic.Parser.Machine.Input.offset farInp,
41 Symantic.Parser.Machine.Generate.parsingErrorException = exn,
42 Symantic.Parser.Machine.Generate.parsingErrorUnexpected =
43 if readMore farInp
44 then
45 GHC.Maybe.Just
46 ( let (#
47 c,
48 _
49 #) = readNext farInp
50 in c
51 )
52 else GHC.Maybe.Nothing,
53 Symantic.Parser.Machine.Generate.parsingErrorExpecting = farExp
54 }
55 in GHC.ST.runST
56 ( let inputToken = Data.Proxy.Proxy :: Data.Proxy.Proxy (Symantic.Parser.Machine.Input.InputToken inp)
57 in let
58 in do
59 let dupv = \x -> x
60 reg <- GHC.STRef.newSTRef dupv
61 let _ = "iter"
62 in let catchHandler loopInput (!_exn) (!failInp) (!farInp) (!farExp) =
63 if ( \( Data.Text.Internal.Text
64 _
65 i
66 _
67 )
68 ( Data.Text.Internal.Text
69 _
70 j
71 _
72 ) -> i GHC.Classes.== j
73 )
74 loopInput
75 failInp
76 then
77 let _ = "choicesBranch.then"
78 in do
79 sr <- GHC.STRef.readSTRef reg
80 let join = \farInp farExp v (!inp) ->
81 let _ = "resume"
82 in finalRet
83 farInp
84 farExp
85 ( let _ = "resume.genCode"
86 in GHC.Show.show (sr GHC.Types . [])
87 )
88 inp
89 in let _ = "catch ExceptionFailure"
90 in let catchHandler (!_exn) (!failInp) (!farInp) (!farExp) =
91 let _ = "catch.ko ExceptionFailure"
92 in if ( \( Data.Text.Internal.Text
93 _
94 i
95 _
96 )
97 ( Data.Text.Internal.Text
98 _
99 j
100 _
101 ) -> i GHC.Classes.== j
102 )
103 failInp
104 failInp
105 then
106 let _ = "choicesBranch.then"
107 in let failExp = Data.Set.Internal.Bin 1 (Symantic.Parser.Grammar.Combinators.SomeFailure Symantic.Parser.Grammar.Combinators.FailureEnd) Data.Set.Internal.Tip Data.Set.Internal.Tip
108 in let (#
109 farInp,
110 farExp
111 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
112 GHC.Types.LT ->
113 (#
114 failInp,
115 failExp
116 #)
117 GHC.Types.EQ ->
118 (#
119 farInp,
120 failExp GHC.Base.<> farExp
121 #)
122 GHC.Types.GT ->
123 (#
124 farInp,
125 farExp
126 #)
127 in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp
128 else
129 let _ = "choicesBranch.else"
130 in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp
131 in let _ = "catch ExceptionFailure"
132 in let catchHandler (!_exn) (!failInp) (!farInp) (!farExp) =
133 let _ = "catch.ko ExceptionFailure"
134 in let _ = "resume"
135 in join
136 farInp
137 farExp
138 ( let _ = "resume.genCode"
139 in GHC.Tuple . ()
140 )
141 failInp
142 in let readFail = catchHandler
143 in if readMore failInp
144 then
145 let !(#
146 c,
147 cs
148 #) = readNext failInp
149 in catchHandler Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp
150 else
151 let _ = "checkHorizon.else"
152 in let failExp =
153 Data.Set.Internal.Bin
154 1
155 ( Symantic.Parser.Grammar.Combinators.SomeFailure
156 ( case inputToken of
157 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
158 )
159 )
160 Data.Set.Internal.Tip
161 Data.Set.Internal.Tip
162 in let (#
163 farInp,
164 farExp
165 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
166 GHC.Types.LT ->
167 (#
168 failInp,
169 failExp
170 #)
171 GHC.Types.EQ ->
172 (#
173 farInp,
174 failExp GHC.Base.<> farExp
175 #)
176 GHC.Types.GT ->
177 (#
178 farInp,
179 farExp
180 #)
181 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp
182 else
183 let _ = "choicesBranch.else"
184 in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp farInp farExp
185 loop = \_callReturn callInput callCatchStackByLabel ->
186 let readFail = catchHandler callInput
187 in if readMore callInput
188 then
189 let !(#
190 c,
191 cs
192 #) = readNext callInput
193 in if (GHC.Classes.==) 'r' c
194 then do
195 sr <- GHC.STRef.readSTRef reg
196 do
197 let dupv = \x -> sr ((GHC.Types.:) 'r' x)
198 GHC.STRef.writeSTRef reg dupv
199 let _ = "jump"
200 in loop (GHC.Err.error "invalid return") cs (Data.Map.Internal.Bin 1 Symantic.Parser.Grammar.Combinators.ExceptionFailure readFail Data.Map.Internal.Tip Data.Map.Internal.Tip)
201 else
202 let _ = "checkToken.else"
203 in let failExp =
204 Data.Set.Internal.Bin
205 1
206 ( Symantic.Parser.Grammar.Combinators.SomeFailure
207 ( case inputToken of
208 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'r'
209 )
210 )
211 Data.Set.Internal.Tip
212 Data.Set.Internal.Tip
213 in let (#
214 farInp,
215 farExp
216 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init callInput of
217 GHC.Types.LT ->
218 (#
219 callInput,
220 failExp
221 #)
222 GHC.Types.EQ ->
223 (#
224 init,
225 failExp GHC.Base.<> Data.Set.Internal.empty
226 #)
227 GHC.Types.GT ->
228 (#
229 init,
230 Data.Set.Internal.empty
231 #)
232 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure callInput farInp farExp
233 else
234 let _ = "checkHorizon.else"
235 in let failExp =
236 Data.Set.Internal.Bin
237 1
238 ( Symantic.Parser.Grammar.Combinators.SomeFailure
239 ( case inputToken of
240 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 1
241 )
242 )
243 Data.Set.Internal.Tip
244 Data.Set.Internal.Tip
245 in let (#
246 farInp,
247 farExp
248 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init callInput of
249 GHC.Types.LT ->
250 (#
251 callInput,
252 failExp
253 #)
254 GHC.Types.EQ ->
255 (#
256 init,
257 failExp GHC.Base.<> Data.Set.Internal.empty
258 #)
259 GHC.Types.GT ->
260 (#
261 init,
262 Data.Set.Internal.empty
263 #)
264 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure callInput farInp farExp
265 in let _ = "jump"
266 in loop finalRet init Data.Map.Internal.Tip
267 )