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