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.rsdiffbeforeafterboth--- a/crates/jrsonnet-parser/src/lib.rs
+++ b/crates/jrsonnet-parser/src/lib.rs
@@ -252,10 +252,6 @@
pub rule expr_basic(s: &ParserSettings) -> Expr
= literal(s)
- / quiet!{"$intrinsicThisFile" {Expr::IntrinsicThisFile}}
- / quiet!{"$intrinsicId" {Expr::IntrinsicId}}
- / quiet!{"$intrinsic(" name:id() ")" {Expr::Intrinsic(name)}}
-
/ string_expr(s) / number_expr(s)
/ array_expr(s)
/ obj_expr(s)
crates/jrsonnet-parser/src/source.rsdiffbeforeafterboth--- a/crates/jrsonnet-parser/src/source.rs
+++ b/crates/jrsonnet-parser/src/source.rs
@@ -51,12 +51,6 @@
pub fn short_display(&self) -> ShortDisplay {
ShortDisplay(self.clone())
}
- pub fn full_path(&self) -> String {
- match self.inner() {
- Inner::Real(r) => r.display().to_string(),
- Inner::Virtual(v) => v.to_string(),
- }
- }
/// Returns None if file is virtual
pub fn path(&self) -> Option<&Path> {