difftreelog
build upgrade to 2021 edition
in: master
13 files changed
bindings/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]
cmds/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
crates/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 = [
crates/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"]
crates/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};
crates/jrsonnet-evaluator/src/lib.rsdiffbeforeafterboth--- a/crates/jrsonnet-evaluator/src/lib.rs
+++ b/crates/jrsonnet-evaluator/src/lib.rs
@@ -23,6 +23,8 @@
pub mod typed;
mod val;
+pub use jrsonnet_parser as parser;
+
pub use ctx::*;
pub use dynamic::*;
use error::{Error::*, LocError, Result, StackTraceElement};
@@ -175,7 +177,7 @@
pub(crate) fn with_state<T>(f: impl FnOnce(&EvaluationState) -> T) -> T {
EVAL_STATE.with(|s| f(s.borrow().as_ref().unwrap()))
}
-pub(crate) fn push_frame<T>(
+pub fn push_frame<T>(
e: Option<&ExprLocation>,
frame_desc: impl FnOnce() -> String,
f: impl FnOnce() -> Result<T>,
@@ -184,7 +186,7 @@
}
#[allow(dead_code)]
-pub(crate) fn push_val_frame(
+pub fn push_val_frame(
e: &ExprLocation,
frame_desc: impl FnOnce() -> String,
f: impl FnOnce() -> Result<Val>,
@@ -192,7 +194,7 @@
with_state(|s| s.push_val(e, frame_desc, f))
}
#[allow(dead_code)]
-pub(crate) fn push_description_frame<T>(
+pub fn push_description_frame<T>(
frame_desc: impl FnOnce() -> String,
f: impl FnOnce() -> Result<T>,
) -> Result<T> {
crates/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!(),
crates/jrsonnet-interner/Cargo.tomldiffbeforeafterboth4version = "0.4.2"4version = "0.4.2"5authors = ["Yaroslav Bolyukin <iam@lach.pw>"]5authors = ["Yaroslav Bolyukin <iam@lach.pw>"]6license = "MIT"6license = "MIT"7edition = "2018"7edition = "2021"889[dependencies]9[dependencies]10serde = { version = "1.0" }10serde = { version = "1.0" }crates/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?;
crates/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" }
crates/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>")
crates/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]
crates/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" }