difftreelog
refactor(parser)! remove intrinsic syntax
in: master
There was special support to refer to native functions for stdlib, as otherwise `std.native` was not implementable. However, now evaluator contains support for fancy builtins, and it is possible to reimplement standard library without any parser magic. BREAKING CHANGE: This syntax no longer works: $intrinsic(name), $intrinsicId, $intrinsicThisFile
3 files changed
crates/jrsonnet-parser/src/expr.rsdiffbeforeafterboth341 Index(LocExpr, LocExpr),341 Index(LocExpr, LocExpr),342 /// function(x) x342 /// function(x) x343 Function(ParamsDesc, LocExpr),343 Function(ParamsDesc, LocExpr),344 /// std.thisFile345 IntrinsicThisFile,346 /// std.id,347 IntrinsicId,348 /// std.primitiveEquals349 Intrinsic(IStr),350 /// if true == false then 1 else 2344 /// if true == false then 1 else 2351 IfElse {345 IfElse {352 cond: IfSpecData,346 cond: IfSpecData,crates/jrsonnet-parser/src/lib.rsdiffbeforeafterboth252 pub rule expr_basic(s: &ParserSettings) -> Expr252 pub rule expr_basic(s: &ParserSettings) -> Expr253 = literal(s)253 = literal(s)254255 / quiet!{"$intrinsicThisFile" {Expr::IntrinsicThisFile}}256 / quiet!{"$intrinsicId" {Expr::IntrinsicId}}257 / quiet!{"$intrinsic(" name:id() ")" {Expr::Intrinsic(name)}}258254259 / string_expr(s) / number_expr(s)255 / string_expr(s) / number_expr(s)260 / array_expr(s)256 / array_expr(s)crates/jrsonnet-parser/src/source.rsdiffbeforeafterboth51 pub fn short_display(&self) -> ShortDisplay {51 pub fn short_display(&self) -> ShortDisplay {52 ShortDisplay(self.clone())52 ShortDisplay(self.clone())53 }53 }54 pub fn full_path(&self) -> String {55 match self.inner() {56 Inner::Real(r) => r.display().to_string(),57 Inner::Virtual(v) => v.to_string(),58 }59 }605461 /// Returns None if file is virtual55 /// Returns None if file is virtual62 pub fn path(&self) -> Option<&Path> {56 pub fn path(&self) -> Option<&Path> {