git.delta.rocks / jrsonnet / refs/commits / 86c60d81300b

difftreelog

build upgrade to 2021 edition

Yaroslav Bolyukin2022-03-06parent: #9efbcad.patch.diff
in: master

13 files changed

modifiedbindings/jsonnet/Cargo.tomldiffbeforeafterboth
--- a/bindings/jsonnet/Cargo.toml
+++ b/bindings/jsonnet/Cargo.toml
@@ -4,7 +4,7 @@
 version = "0.4.2"
 authors = ["Yaroslav Bolyukin <iam@lach.pw>"]
 license = "MIT"
-edition = "2018"
+edition = "2021"
 publish = false
 
 [dependencies]
modifiedcmds/jrsonnet/Cargo.tomldiffbeforeafterboth
--- a/cmds/jrsonnet/Cargo.toml
+++ b/cmds/jrsonnet/Cargo.toml
@@ -4,8 +4,7 @@
 version = "0.4.2"
 authors = ["Yaroslav Bolyukin <iam@lach.pw>"]
 license = "MIT"
-edition = "2018"
-publish = false
+edition = "2021"
 
 [features]
 # Use mimalloc as allocator
modifiedcrates/jrsonnet-cli/Cargo.tomldiffbeforeafterboth
--- a/crates/jrsonnet-cli/Cargo.toml
+++ b/crates/jrsonnet-cli/Cargo.toml
@@ -4,8 +4,7 @@
 version = "0.4.2"
 authors = ["Yaroslav Bolyukin <iam@lach.pw>"]
 license = "MIT"
-edition = "2018"
-publish = false
+edition = "2021"
 
 [dependencies]
 jrsonnet-evaluator = { path = "../../crates/jrsonnet-evaluator", version = "0.4.2", features = [
modifiedcrates/jrsonnet-evaluator/Cargo.tomldiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/Cargo.toml
+++ b/crates/jrsonnet-evaluator/Cargo.toml
@@ -4,7 +4,7 @@
 version = "0.4.2"
 authors = ["Yaroslav Bolyukin <iam@lach.pw>"]
 license = "MIT"
-edition = "2018"
+edition = "2021"
 
 [features]
 default = ["serialized-stdlib", "explaining-traces"]
modifiedcrates/jrsonnet-evaluator/src/builtin/mod.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/builtin/mod.rs
+++ b/crates/jrsonnet-evaluator/src/builtin/mod.rs
@@ -7,7 +7,7 @@
 	operator::evaluate_mod_op,
 	primitive_equals, push_frame, throw,
 	typed::{Either2, Either4},
-	with_state, ArrValue, Context, FuncVal, IndexableVal, Val,
+	with_state, ArrValue, FuncVal, IndexableVal, Val,
 };
 use crate::{Either, ObjValue};
 use format::{format_arr, format_obj};
modifiedcrates/jrsonnet-evaluator/src/lib.rsdiffbeforeafterboth
23pub mod typed;23pub mod typed;
24mod val;24mod val;
25
26pub use jrsonnet_parser as parser;
2527
26pub use ctx::*;28pub use ctx::*;
27pub use dynamic::*;29pub use dynamic::*;
175pub(crate) fn with_state<T>(f: impl FnOnce(&EvaluationState) -> T) -> T {177pub(crate) fn with_state<T>(f: impl FnOnce(&EvaluationState) -> T) -> T {
176 EVAL_STATE.with(|s| f(s.borrow().as_ref().unwrap()))178 EVAL_STATE.with(|s| f(s.borrow().as_ref().unwrap()))
177}179}
178pub(crate) fn push_frame<T>(180pub fn push_frame<T>(
179 e: Option<&ExprLocation>,181 e: Option<&ExprLocation>,
180 frame_desc: impl FnOnce() -> String,182 frame_desc: impl FnOnce() -> String,
181 f: impl FnOnce() -> Result<T>,183 f: impl FnOnce() -> Result<T>,
184}186}
185187
186#[allow(dead_code)]188#[allow(dead_code)]
187pub(crate) fn push_val_frame(189pub fn push_val_frame(
188 e: &ExprLocation,190 e: &ExprLocation,
189 frame_desc: impl FnOnce() -> String,191 frame_desc: impl FnOnce() -> String,
190 f: impl FnOnce() -> Result<Val>,192 f: impl FnOnce() -> Result<Val>,
191) -> Result<Val> {193) -> Result<Val> {
192 with_state(|s| s.push_val(e, frame_desc, f))194 with_state(|s| s.push_val(e, frame_desc, f))
193}195}
194#[allow(dead_code)]196#[allow(dead_code)]
195pub(crate) fn push_description_frame<T>(197pub fn push_description_frame<T>(
196 frame_desc: impl FnOnce() -> String,198 frame_desc: impl FnOnce() -> String,
197 f: impl FnOnce() -> Result<T>,199 f: impl FnOnce() -> Result<T>,
198) -> Result<T> {200) -> Result<T> {
modifiedcrates/jrsonnet-evaluator/src/typed/mod.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/typed/mod.rs
+++ b/crates/jrsonnet-evaluator/src/typed/mod.rs
@@ -13,9 +13,9 @@
 
 #[macro_export]
 macro_rules! unwrap_type {
-	($desc: expr, $value: expr, $typ: expr => $match: path) => {{
-		use $crate::{push_stack_frame, typed::CheckType};
-		push_stack_frame(None, $desc, || Ok($typ.check(&$value)?))?;
+	($desc:expr, $value:expr, $typ:expr => $match:path) => {{
+		use $crate::{push_frame, typed::CheckType};
+		push_frame(None, $desc, || Ok($typ.check(&$value)?))?;
 		match $value {
 			$match(v) => v,
 			_ => unreachable!(),
modifiedcrates/jrsonnet-interner/Cargo.tomldiffbeforeafterboth
--- a/crates/jrsonnet-interner/Cargo.toml
+++ b/crates/jrsonnet-interner/Cargo.toml
@@ -4,7 +4,7 @@
 version = "0.4.2"
 authors = ["Yaroslav Bolyukin <iam@lach.pw>"]
 license = "MIT"
-edition = "2018"
+edition = "2021"
 
 [dependencies]
 serde = { version = "1.0" }
modifiedcrates/jrsonnet-macros/src/lib.rsdiffbeforeafterboth
--- a/crates/jrsonnet-macros/src/lib.rs
+++ b/crates/jrsonnet-macros/src/lib.rs
@@ -136,7 +136,11 @@
 		#[derive(Clone, Copy, gcmodule::Trace)]
 		#vis struct #name {}
 		const _: () = {
-			use ::jrsonnet_evaluator::function::{Builtin, StaticBuiltin, BuiltinParam, ArgsLike};
+			use ::jrsonnet_evaluator::{
+				function::{Builtin, StaticBuiltin, BuiltinParam, ArgsLike, parse_builtin_call},
+				error::Result, Context,
+				parser::ExprLocation,
+			};
 			const PARAMS: &'static [BuiltinParam] = &[
 				#(#params),*
 			];
@@ -156,7 +160,7 @@
 					PARAMS
 				}
 				fn call(&self, context: Context, loc: Option<&ExprLocation>, args: &dyn ArgsLike) -> Result<Val> {
-					let parsed = ::jrsonnet_evaluator::function::parse_builtin_call(context, &PARAMS, args, false)?;
+					let parsed = parse_builtin_call(context, &PARAMS, args, false)?;
 
 					let result: #result = #name(#(#args),*);
 					let result = result?;
modifiedcrates/jrsonnet-parser/Cargo.tomldiffbeforeafterboth
--- a/crates/jrsonnet-parser/Cargo.toml
+++ b/crates/jrsonnet-parser/Cargo.toml
@@ -4,7 +4,7 @@
 version = "0.4.2"
 authors = ["Yaroslav Bolyukin <iam@lach.pw>"]
 license = "MIT"
-edition = "2018"
+edition = "2021"
 
 [features]
 default = []
@@ -14,7 +14,7 @@
 [dependencies]
 jrsonnet-interner = { path = "../jrsonnet-interner", version = "0.4.2" }
 
-peg = "0.7.0"
+peg = "0.8.0"
 
 serde = { version = "1.0", features = ["derive", "rc"], optional = true }
 gcmodule = { git = "https://github.com/CertainLach/gcmodule", branch = "jrsonnet" }
modifiedcrates/jrsonnet-parser/src/lib.rsdiffbeforeafterboth
--- a/crates/jrsonnet-parser/src/lib.rs
+++ b/crates/jrsonnet-parser/src/lib.rs
@@ -114,8 +114,8 @@
 			/ "\\x" hex_char() hex_char()
 			/ ['\\'] (quiet! { ['b' | 'f' | 'n' | 'r' | 't'] / c() } / expected!("<escape character>"))
 		pub rule string() -> String
-			= ['"'] str:$(string_char(<['"']>)*) ['"'] {? unescape::unescape(str).ok_or("<escaped string>")}
-			/ ['\''] str:$(string_char(<['\'']>)*) ['\''] {? unescape::unescape(str).ok_or("<escaped string>")}
+			= ['"'] str:$(string_char(<"\"">)*) ['"'] {? unescape::unescape(str).ok_or("<escaped string>")}
+			/ ['\''] str:$(string_char(<"\'">)*) ['\''] {? unescape::unescape(str).ok_or("<escaped string>")}
 			/ quiet!{ "@'" str:$(("''" / (!['\''][_]))*) "'" {str.replace("''", "'")}
 			/ "@\"" str:$(("\"\"" / (!['"'][_]))*) "\"" {str.replace("\"\"", "\"")}
 			/ string_block() } / expected!("<string>")
modifiedcrates/jrsonnet-stdlib/Cargo.tomldiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/Cargo.toml
+++ b/crates/jrsonnet-stdlib/Cargo.toml
@@ -4,7 +4,7 @@
 version = "0.4.2"
 authors = ["Yaroslav Bolyukin <iam@lach.pw>"]
 license = "MIT"
-edition = "2018"
+edition = "2021"
 
 [features]
 
modifiedcrates/jrsonnet-types/Cargo.tomldiffbeforeafterboth
--- a/crates/jrsonnet-types/Cargo.toml
+++ b/crates/jrsonnet-types/Cargo.toml
@@ -4,8 +4,8 @@
 version = "0.4.2"
 authors = ["Yaroslav Bolyukin <iam@lach.pw>"]
 license = "MIT"
-edition = "2018"
+edition = "2021"
 
 [dependencies]
-peg = "0.7.0"
+peg = "0.8.0"
 gcmodule = { git = "https://github.com/CertainLach/gcmodule", branch = "jrsonnet" }