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