]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G3.expected.txt
machine: make failure be minReads=0
[haskell/symantic-parser.git] / test / Golden / Splice / G3.expected.txt
1 \(input_0 :: inp_6989586621679040759) ->
2 let !(#
3 init_1,
4 readMore_2,
5 readNext_3
6 #) =
7 let _ = "cursorOf"
8 in let next_4
9 ( t_5@( Data.Text.Internal.Text
10 arr_6
11 off_7
12 unconsumed_8
13 )
14 ) =
15 let !( Data.Text.Unsafe.Iter
16 c_9
17 d_10
18 ) = Data.Text.Unsafe.iter t_5 0
19 in (#
20 c_9,
21 Data.Text.Internal.Text arr_6 (off_7 GHC.Num.+ d_10) (unconsumed_8 GHC.Num.- d_10)
22 #)
23 more_11
24 ( Data.Text.Internal.Text
25 _
26 _
27 unconsumed_12
28 ) = unconsumed_12 GHC.Classes.> 0
29 in (#
30 input_0,
31 more_11,
32 next_4
33 #)
34 finalRet_13 = \_farInp_14 _farExp_15 v_16 _inp_17 -> Symantic.Parser.Machine.Generate.returnST GHC.Base.$ Data.Either.Right v_16
35 finalRaise_18 ::
36 forall st_19 b_20.
37 Symantic.Parser.Machine.Generate.Catcher
38 st_19
39 inp_6989586621679040759
40 b_20 = \(!exn_21) _failInp_22 (!farInp_23) (!farExp_24) ->
41 Symantic.Parser.Machine.Generate.returnST GHC.Base.$
42 Data.Either.Left
43 Symantic.Parser.Machine.Generate.ParsingError
44 { Symantic.Parser.Machine.Generate.parsingErrorOffset = Symantic.Parser.Machine.Input.offset farInp_23,
45 Symantic.Parser.Machine.Generate.parsingErrorException = exn_21,
46 Symantic.Parser.Machine.Generate.parsingErrorUnexpected =
47 if readMore_2 farInp_23
48 then
49 GHC.Maybe.Just
50 ( let (#
51 c_25,
52 _
53 #) = readNext_3 farInp_23
54 in c_25
55 )
56 else GHC.Maybe.Nothing,
57 Symantic.Parser.Machine.Generate.parsingErrorExpecting =
58 let ( minHoriz_26,
59 res_27
60 ) =
61 Data.Set.Internal.foldr
62 ( \f_28
63 ( minH_29,
64 acc_30
65 ) -> case Symantic.Parser.Grammar.Combinators.unSomeFailure f_28 of
66 GHC.Maybe.Just (Symantic.Parser.Grammar.Combinators.FailureHorizon h_31 :: Symantic.Parser.Grammar.Combinators.Failure (Symantic.Parser.Grammar.Combinators.CombSatisfiable (Symantic.Parser.Machine.Input.InputToken inp_6989586621679040759)))
67 | GHC.Maybe.Just old_32 <- minH_29 ->
68 ( GHC.Maybe.Just (GHC.Classes.min old_32 h_31),
69 acc_30
70 )
71 | GHC.Base.otherwise ->
72 ( GHC.Maybe.Just h_31,
73 acc_30
74 )
75 _ ->
76 ( minH_29,
77 f_28 GHC.Types.: acc_30
78 )
79 )
80 ( GHC.Maybe.Nothing,
81 GHC.Types . []
82 )
83 farExp_24
84 in Data.Set.Internal.fromList GHC.Base.$
85 ( case minHoriz_26 of
86 GHC.Maybe.Just h_33 -> Symantic.Parser.Grammar.Combinators.SomeFailure (Symantic.Parser.Grammar.Combinators.FailureHorizon @(Symantic.Parser.Machine.Input.InputToken inp_6989586621679040759) h_33) GHC.Types.: res_27
87 GHC.Maybe.Nothing -> res_27
88 )
89 }
90 in GHC.ST.runST
91 ( let inputToken = Data.Proxy.Proxy :: Data.Proxy.Proxy (Symantic.Parser.Machine.Input.InputToken inp_6989586621679040759)
92 in let _ = "checkHorizon.noCheck"
93 in let
94 in let _ = "pushValue"
95 in let _ = "pushValue"
96 in do
97 let dupv_34 = \x_35 -> x_35
98 reg_36 <- GHC.STRef.newSTRef dupv_34
99 let _ = "iter"
100 in let catchHandler_37 loopInput_38 (!_exn_39) (!failInp_40) (!farInp_41) (!farExp_42) =
101 let _ = "pushInput"
102 in if ( \( Data.Text.Internal.Text
103 _
104 i_43
105 _
106 )
107 ( Data.Text.Internal.Text
108 _
109 j_44
110 _
111 ) -> i_43 GHC.Classes.== j_44
112 )
113 loopInput_38
114 failInp_40
115 then
116 let _ = "choicesBranch.then"
117 in do
118 sr_45 <- GHC.STRef.readSTRef reg_36
119 let _ = "pushValue"
120 in let _ = "resume"
121 in finalRet_13
122 farInp_41
123 farExp_42
124 ( let _ = "resume.genCode"
125 in GHC.Show.show (sr_45 GHC.Types . [])
126 )
127 failInp_40
128 else
129 let _ = "choicesBranch.else"
130 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure failInp_40 farInp_41 farExp_42
131 loop_46 = \_callReturn_47 callInput_48 callCatchStackByLabel_49 ->
132 let _ = "pushValue"
133 in let _ = "comment: satisfy"
134 in let inp_50 = callInput_48
135 in let readFail_51 = catchHandler_37 callInput_48
136 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=1"
137 in if readMore_2 inp_50
138 then
139 let _ = "checkToken"
140 in let !(#
141 c_52,
142 cs_53
143 #) = readNext_3 inp_50
144 in if (GHC.Classes.==) 'a' c_52
145 then
146 let _ = "pushValue"
147 in do
148 sr_54 <- GHC.STRef.readSTRef reg_36
149 do
150 let dupv_55 = \x_56 -> sr_54 ((GHC.Types.:) 'a' x_56)
151 GHC.STRef.writeSTRef reg_36 dupv_55
152 let _ = "jump"
153 in loop_46 (GHC.Err.error "invalid return") cs_53 (Data.Map.Internal.Bin 1 Symantic.Parser.Grammar.Combinators.ExceptionFailure readFail_51 Data.Map.Internal.Tip Data.Map.Internal.Tip)
154 else
155 let _ = "checkToken.fail"
156 in let failExp_57 =
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'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
162 )
163 )
164 Data.Set.Internal.Tip
165 Data.Set.Internal.Tip
166 in let (#
167 farInp_58,
168 farExp_59
169 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 inp_50 of
170 GHC.Types.LT ->
171 (#
172 inp_50,
173 failExp_57
174 #)
175 GHC.Types.EQ ->
176 (#
177 init_1,
178 failExp_57 GHC.Base.<> Data.Set.Internal.empty
179 #)
180 GHC.Types.GT ->
181 (#
182 init_1,
183 Data.Set.Internal.empty
184 #)
185 in readFail_51 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_50 farInp_58 farExp_59
186 else
187 let _ = "checkHorizon.newCheck.fail"
188 in let failExp_60 =
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'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok'_6989586621679080671 1
194 )
195 )
196 Data.Set.Internal.Tip
197 Data.Set.Internal.Tip
198 in let (#
199 farInp_61,
200 farExp_62
201 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 inp_50 of
202 GHC.Types.LT ->
203 (#
204 inp_50,
205 failExp_60
206 #)
207 GHC.Types.EQ ->
208 (#
209 init_1,
210 failExp_60 GHC.Base.<> Data.Set.Internal.empty
211 #)
212 GHC.Types.GT ->
213 (#
214 init_1,
215 Data.Set.Internal.empty
216 #)
217 in readFail_51 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_50 farInp_61 farExp_62
218 in let _ = "jump"
219 in loop_46 finalRet_13 init_1 Data.Map.Internal.Tip
220 )