]> Git — Sourcephile - haskell/symantic-parser.git/blob - test/Golden/Splice/G1.expected.txt
machine: make failure be minReads=0
[haskell/symantic-parser.git] / test / Golden / Splice / G1.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 inp_34 = init_1
93 in let readFail_35 = finalRaise_18
94 in let _ = "checkHorizon.newCheck: checkedHorizon=0 minHoriz=1"
95 in if readMore_2 inp_34
96 then
97 let
98 in let _ = "pushValue"
99 in let _ = "comment: satisfy"
100 in let _ = "checkHorizon.oldCheck: checkedHorizon=1"
101 in let _ = "checkToken"
102 in let !(#
103 c_36,
104 cs_37
105 #) = readNext_3 inp_34
106 in if (GHC.Classes.==) 'a' c_36
107 then
108 let _ = "resume"
109 in finalRet_13
110 init_1
111 Data.Set.Internal.empty
112 ( let _ = "resume.genCode"
113 in GHC.Show.show 'a'
114 )
115 cs_37
116 else
117 let _ = "checkToken.fail"
118 in let failExp_38 =
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'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureToken 'a'
124 )
125 )
126 Data.Set.Internal.Tip
127 Data.Set.Internal.Tip
128 in let (#
129 farInp_39,
130 farExp_40
131 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 inp_34 of
132 GHC.Types.LT ->
133 (#
134 inp_34,
135 failExp_38
136 #)
137 GHC.Types.EQ ->
138 (#
139 init_1,
140 failExp_38 GHC.Base.<> Data.Set.Internal.empty
141 #)
142 GHC.Types.GT ->
143 (#
144 init_1,
145 Data.Set.Internal.empty
146 #)
147 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_34 farInp_39 farExp_40
148 else
149 let _ = "checkHorizon.newCheck.fail"
150 in let failExp_41 =
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'_6989586621679080671) -> Symantic.Parser.Grammar.Combinators.FailureHorizon @tok'_6989586621679080671 1
156 )
157 )
158 Data.Set.Internal.Tip
159 Data.Set.Internal.Tip
160 in let (#
161 farInp_42,
162 farExp_43
163 #) = case (GHC.Classes.compare `Data.Function.on` Symantic.Parser.Machine.Input.offset) init_1 inp_34 of
164 GHC.Types.LT ->
165 (#
166 inp_34,
167 failExp_41
168 #)
169 GHC.Types.EQ ->
170 (#
171 init_1,
172 failExp_41 GHC.Base.<> Data.Set.Internal.empty
173 #)
174 GHC.Types.GT ->
175 (#
176 init_1,
177 Data.Set.Internal.empty
178 #)
179 in finalRaise_18 Symantic.Parser.Grammar.Combinators.ExceptionFailure inp_34 farInp_42 farExp_43
180 )