]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G3.expected.txt
test: dump splices using TH.runQ instead of calling ghc
[haskell/symantic-parser.git] / test / Golden / Splice / G3.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 name = \(!ok) (!inp) (!koByLabel) ->
53 let _ = "catchException lbl=fail"
54 in let catchHandler (!failInp) (!farInp) (!farExp) =
55 let _ = "catchException.ko lbl=fail"
56 in if ( \( Data.Text.Internal.Text
57 _
58 i
59 _
60 )
61 ( Data.Text.Internal.Text
62 _
63 j
64 _
65 ) -> i GHC.Classes.== j
66 )
67 inp
68 failInp
69 then
70 let _ = "choicesBranch.then"
71 in let _ = "resume"
72 in ok
73 farInp
74 farExp
75 ( let _ = "resume.genCode"
76 in \x -> x
77 )
78 failInp
79 else
80 let _ = "choicesBranch.else"
81 in let (#
82 farInp,
83 farExp
84 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) farInp failInp of
85 GHC.Types.LT ->
86 (#
87 failInp,
88 []
89 #)
90 GHC.Types.EQ ->
91 (#
92 farInp,
93 farExp GHC.Base.<> []
94 #)
95 GHC.Types.GT ->
96 (#
97 farInp,
98 farExp
99 #)
100 in finalRaise failInp farInp farExp
101 in let readFail = catchHandler
102 in if readMore inp
103 then
104 let !(#
105 c,
106 cs
107 #) = readNext inp
108 in if ('a' GHC.Classes.==) c
109 then
110 name
111 ( let _ = "suspend"
112 in \farInp farExp v (!inp) ->
113 let _ = "resume"
114 in ok
115 farInp
116 farExp
117 ( let _ = "resume.genCode"
118 in \x -> 'a' GHC.Types.: v x
119 )
120 inp
121 )
122 cs
123 Data.Map.Internal.Tip
124 else
125 let _ = "checkToken.else"
126 in let (#
127 farInp,
128 farExp
129 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init inp of
130 GHC.Types.LT ->
131 (#
132 inp,
133 [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'a']
134 #)
135 GHC.Types.EQ ->
136 (#
137 init,
138 GHC.Types . [] GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemToken 'a']
139 #)
140 GHC.Types.GT ->
141 (#
142 init,
143 GHC.Types . []
144 #)
145 in readFail inp farInp farExp
146 else
147 let _ = "checkHorizon.else"
148 in let (#
149 farInp,
150 farExp
151 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init inp of
152 GHC.Types.LT ->
153 (#
154 inp,
155 [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 1]
156 #)
157 GHC.Types.EQ ->
158 (#
159 init,
160 GHC.Types . [] GHC.Base.<> [Symantic.Parser.Grammar.Combinators.ErrorItemHorizon 1]
161 #)
162 GHC.Types.GT ->
163 (#
164 init,
165 GHC.Types . []
166 #)
167 in readFail inp farInp farExp
168 in name
169 ( let _ = "suspend"
170 in \farInp farExp v (!inp) ->
171 let _ = "resume"
172 in finalRet
173 farInp
174 farExp
175 ( let _ = "resume.genCode"
176 in GHC.Show.show (v GHC.Types . [])
177 )
178 inp
179 )
180 init
181 Data.Map.Internal.Tip