]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G9.expected.txt
test: dump splices using TH.runQ instead of calling ghc
[haskell/symantic-parser.git] / test / Golden / Splice / G9.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 (#
81 farInp,
82 farExp
83 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
84 GHC.Types.LT ->
85 (#
86 failInp,
87 [Symantic.Parser.Grammar.Combinators.ErrorItemEnd]
88 #)
89 GHC.Types.EQ ->
90 (#
91 farInp,
92 farExp GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemEnd]
93 #)
94 GHC.Types.GT ->
95 (#
96 farInp,
97 farExp
98 #)
99 in finalRaise failInp farInp farExp
100 else
101 let _ = "choicesBranch.else"
102 in let (#
103 farInp,
104 farExp
105 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
106 GHC.Types.LT ->
107 (#
108 failInp,
109 []
110 #)
111 GHC.Types.EQ ->
112 (#
113 farInp,
114 farExp GHC.Base.<> []
115 #)
116 GHC.Types.GT ->
117 (#
118 farInp,
119 farExp
120 #)
121 in finalRaise failInp farInp farExp
122 in let _ = "catchException lbl=fail"
123 in let catchHandler (!failInp) (!farInp) (!farExp) =
124 let _ = "catchException.ko lbl=fail"
125 in let _ = "resume"
126 in join
127 farInp
128 farExp
129 ( let _ = "resume.genCode"
130 in GHC.Tuple . ()
131 )
132 init
133 in let readFail = catchHandler
134 in if readMore init
135 then
136 let !(# c, cs #) = readNext init
137 in if (\x -> GHC.Types.True) c
138 then
139 let (#
140 farInp,
141 farExp
142 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init init of
143 GHC.Types.LT ->
144 (#
145 init,
146 []
147 #)
148 GHC.Types.EQ ->
149 (#
150 init,
151 GHC.Types . [] GHC.Base.<> []
152 #)
153 GHC.Types.GT ->
154 (#
155 init,
156 GHC.Types . []
157 #)
158 in catchHandler init farInp farExp
159 else
160 let _ = "checkToken.else"
161 in let (#
162 farInp,
163 farExp
164 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init init of
165 GHC.Types.LT ->
166 (#
167 init,
168 []
169 #)
170 GHC.Types.EQ ->
171 (#
172 init,
173 GHC.Types . [] GHC.Base.<> []
174 #)
175 GHC.Types.GT ->
176 (#
177 init,
178 GHC.Types . []
179 #)
180 in readFail init farInp farExp
181 else
182 let _ = "checkHorizon.else"
183 in let (#
184 farInp,
185 farExp
186 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init init of
187 GHC.Types.LT ->
188 (#
189 init,
190 [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 1]
191 #)
192 GHC.Types.EQ ->
193 (#
194 init,
195 GHC.Types . [] GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 1]
196 #)
197 GHC.Types.GT ->
198 (#
199 init,
200 GHC.Types . []
201 #)
202 in readFail init farInp farExp