]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G2.expected.txt
add registers
[haskell/symantic-parser.git] / test / Golden / Splice / G2.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 let _ = "catch ExceptionFailure"
59 in let catchHandler (!_exn) (!failInp) (!farInp) (!farExp) =
60 let _ = "catch.ko ExceptionFailure"
61 in finalRaise Symantic.Parser.Grammar.Combinators.ExceptionFailure init farInp farExp
62 in let readFail = catchHandler
63 in if readMore (Symantic.Parser.Machine.Input.shiftRightText 2 init)
64 then
65 let !(# c, cs #) = readNext init
66 in if (GHC.Classes.==) 'a' c
67 then
68 let readFail = readFail
69 in let !(#
70 c,
71 cs
72 #) = readNext cs
73 in if (GHC.Classes.==) 'b' c
74 then
75 let readFail = readFail
76 in let !(#
77 c,
78 cs
79 #) = readNext cs
80 in if (GHC.Classes.==) 'c' c
81 then
82 let _ = "resume"
83 in finalRet
84 init
85 Data.Set.Internal.empty
86 ( let _ = "resume.genCode"
87 in GHC.Show.show ((GHC.Types.:) 'a' ((GHC.Types.:) 'b' ((GHC.Types.:) 'c' GHC.Types . [])))
88 )
89 cs
90 else
91 let _ = "checkToken.else"
92 in let failExp =
93 Data.Set.Internal.Bin
94 1
95 ( Symantic.Parser.Grammar.Combinators.SomeFailure
96 ( case inputToken of
97 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'c'
98 )
99 )
100 Data.Set.Internal.Tip
101 Data.Set.Internal.Tip
102 in let (#
103 farInp,
104 farExp
105 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init cs of
106 GHC.Types.LT ->
107 (#
108 cs,
109 failExp
110 #)
111 GHC.Types.EQ ->
112 (#
113 init,
114 failExp GHC.Base.<> Data.Set.Internal.empty
115 #)
116 GHC.Types.GT ->
117 (#
118 init,
119 Data.Set.Internal.empty
120 #)
121 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure cs farInp farExp
122 else
123 let _ = "checkToken.else"
124 in let failExp =
125 Data.Set.Internal.Bin
126 1
127 ( Symantic.Parser.Grammar.Combinators.SomeFailure
128 ( case inputToken of
129 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'b'
130 )
131 )
132 Data.Set.Internal.Tip
133 Data.Set.Internal.Tip
134 in let (#
135 farInp,
136 farExp
137 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init cs of
138 GHC.Types.LT ->
139 (#
140 cs,
141 failExp
142 #)
143 GHC.Types.EQ ->
144 (#
145 init,
146 failExp GHC.Base.<> Data.Set.Internal.empty
147 #)
148 GHC.Types.GT ->
149 (#
150 init,
151 Data.Set.Internal.empty
152 #)
153 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure cs farInp farExp
154 else
155 let _ = "checkToken.else"
156 in let failExp =
157 Data.Set.Internal.Bin
158 1
159 ( Symantic.Parser.Grammar.Combinators.SomeFailure
160 ( case inputToken of
161 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
162 )
163 )
164 Data.Set.Internal.Tip
165 Data.Set.Internal.Tip
166 in let (#
167 farInp,
168 farExp
169 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init init of
170 GHC.Types.LT ->
171 (#
172 init,
173 failExp
174 #)
175 GHC.Types.EQ ->
176 (#
177 init,
178 failExp GHC.Base.<> Data.Set.Internal.empty
179 #)
180 GHC.Types.GT ->
181 (#
182 init,
183 Data.Set.Internal.empty
184 #)
185 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure init farInp farExp
186 else
187 let _ = "checkHorizon.else"
188 in let failExp =
189 Data.Set.Internal.Bin
190 1
191 ( Symantic.Parser.Grammar.Combinators.SomeFailure
192 ( case inputToken of
193 (Data.Proxy.Proxy :: Data.Proxy.Proxy tok') -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok' 3
194 )
195 )
196 Data.Set.Internal.Tip
197 Data.Set.Internal.Tip
198 in let (#
199 farInp,
200 farExp
201 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init init of
202 GHC.Types.LT ->
203 (#
204 init,
205 failExp
206 #)
207 GHC.Types.EQ ->
208 (#
209 init,
210 failExp GHC.Base.<> Data.Set.Internal.empty
211 #)
212 GHC.Types.GT ->
213 (#
214 init,
215 Data.Set.Internal.empty
216 #)
217 in readFail Symantic.Parser.Grammar.Combinators.ExceptionFailure init farInp farExp
218 )