git.delta.rocks / jrsonnet / refs/commits / c08e7d892b3e

difftreelog

refactor(parser) remove useless AST expressions

Лач2020-06-14parent: #b7f33d3.patch.diff
in: master

1 file changed

modifiedcrates/jsonnet-parser/src/expr.rsdiffbeforeafterboth
176 /// (obj)176 /// (obj)
177 Parened(LocExpr),177 Parened(LocExpr),
178
179 /// Params in function definition
180 /// hello, world, test = 2
181 Params(ParamsDesc),
182 /// Args in function call
183 /// 2 + 2, 3, named = 6
184 Args(ArgsDesc),
185178
186 /// -2179 /// -2
187 UnaryOp(UnaryOpType, LocExpr),180 UnaryOp(UnaryOpType, LocExpr),
192 /// local a = 2; { b: a }185 /// local a = 2; { b: a }
193 LocalExpr(Vec<BindSpec>, LocExpr),186 LocalExpr(Vec<BindSpec>, LocExpr),
194187
195 /// a = 3
196 Bind(BindSpec),
197 /// import "hello"188 /// import "hello"
198 Import(PathBuf),189 Import(PathBuf),
199 /// importStr "file.txt"190 /// importStr "file.txt"
202 Error(LocExpr),193 Error(LocExpr),
203 /// a(b, c)194 /// a(b, c)
204 Apply(LocExpr, ArgsDesc, bool),195 Apply(LocExpr, ArgsDesc, bool),
205 ///
206 Select(LocExpr, String),
207 /// a[b]196 /// a[b]
208 Index(LocExpr, LocExpr),197 Index(LocExpr, LocExpr),
209 /// a[1::2]
210 Slice(LocExpr, SliceDesc),
211 /// function(x) x198 /// function(x) x
212 Function(ParamsDesc, LocExpr),199 Function(ParamsDesc, LocExpr),
213 /// if true == false then 1 else 2200 /// if true == false then 1 else 2
216 cond_then: LocExpr,203 cond_then: LocExpr,
217 cond_else: Option<LocExpr>,204 cond_else: Option<LocExpr>,
218 },205 },
219 /// if 2 = 3
220 IfSpec(IfSpecData),
221 /// for elem in array
222 ForSpec(ForSpecData),
223}206}
224207
225/// file, begin offset, end offset208/// file, begin offset, end offset