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.rsdiffbeforeafterboth--- a/crates/jrsonnet-parser/src/expr.rs
+++ b/crates/jrsonnet-parser/src/expr.rs
@@ -341,12 +341,6 @@
Index(LocExpr, LocExpr),
/// function(x) x
Function(ParamsDesc, LocExpr),
- /// std.thisFile
- IntrinsicThisFile,
- /// std.id,
- IntrinsicId,
- /// std.primitiveEquals
- Intrinsic(IStr),
/// if true == false then 1 else 2
IfElse {
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.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> {