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
4version = "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"
8publish = false8publish = false
99
10[dependencies]10[dependencies]
modifiedcmds/jrsonnet/Cargo.tomldiffbeforeafterboth
4version = "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"
8publish = false
98
10[features]9[features]
11# Use mimalloc as allocator10# Use mimalloc as allocator
modifiedcrates/jrsonnet-cli/Cargo.tomldiffbeforeafterboth
4version = "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"
8publish = false
98
10[dependencies]9[dependencies]
11jrsonnet-evaluator = { path = "../../crates/jrsonnet-evaluator", version = "0.4.2", features = [10jrsonnet-evaluator = { path = "../../crates/jrsonnet-evaluator", version = "0.4.2", features = [
modifiedcrates/jrsonnet-evaluator/Cargo.tomldiffbeforeafterboth
4version = "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"
88
9[features]9[features]
10default = ["serialized-stdlib", "explaining-traces"]10default = ["serialized-stdlib", "explaining-traces"]
modifiedcrates/jrsonnet-evaluator/src/builtin/mod.rsdiffbeforeafterboth
7 operator::evaluate_mod_op,7 operator::evaluate_mod_op,
8 primitive_equals, push_frame, throw,8 primitive_equals, push_frame, throw,
9 typed::{Either2, Either4},9 typed::{Either2, Either4},
10 with_state, ArrValue, Context, FuncVal, IndexableVal, Val,10 with_state, ArrValue, FuncVal, IndexableVal, Val,
11};11};
12use crate::{Either, ObjValue};12use crate::{Either, ObjValue};
13use format::{format_arr, format_obj};13use 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
14#[macro_export]14#[macro_export]
15macro_rules! unwrap_type {15macro_rules! unwrap_type {
16 ($desc: expr, $value: expr, $typ: expr => $match: path) => {{16 ($desc:expr, $value:expr, $typ:expr => $match:path) => {{
17 use $crate::{push_stack_frame, typed::CheckType};17 use $crate::{push_frame, typed::CheckType};
18 push_stack_frame(None, $desc, || Ok($typ.check(&$value)?))?;18 push_frame(None, $desc, || Ok($typ.check(&$value)?))?;
19 match $value {19 match $value {
20 $match(v) => v,20 $match(v) => v,
21 _ => unreachable!(),21 _ => unreachable!(),
modifiedcrates/jrsonnet-interner/Cargo.tomldiffbeforeafterboth
4version = "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"
88
9[dependencies]9[dependencies]
10serde = { version = "1.0" }10serde = { version = "1.0" }
modifiedcrates/jrsonnet-macros/src/lib.rsdiffbeforeafterboth
136 #[derive(Clone, Copy, gcmodule::Trace)]136 #[derive(Clone, Copy, gcmodule::Trace)]
137 #vis struct #name {}137 #vis struct #name {}
138 const _: () = {138 const _: () = {
139 use ::jrsonnet_evaluator::function::{Builtin, StaticBuiltin, BuiltinParam, ArgsLike};139 use ::jrsonnet_evaluator::{
140 function::{Builtin, StaticBuiltin, BuiltinParam, ArgsLike, parse_builtin_call},
141 error::Result, Context,
142 parser::ExprLocation,
143 };
140 const PARAMS: &'static [BuiltinParam] = &[144 const PARAMS: &'static [BuiltinParam] = &[
141 #(#params),*145 #(#params),*
142 ];146 ];
156 PARAMS160 PARAMS
157 }161 }
158 fn call(&self, context: Context, loc: Option<&ExprLocation>, args: &dyn ArgsLike) -> Result<Val> {162 fn call(&self, context: Context, loc: Option<&ExprLocation>, args: &dyn ArgsLike) -> Result<Val> {
159 let parsed = ::jrsonnet_evaluator::function::parse_builtin_call(context, &PARAMS, args, false)?;163 let parsed = parse_builtin_call(context, &PARAMS, args, false)?;
160164
161 let result: #result = #name(#(#args),*);165 let result: #result = #name(#(#args),*);
162 let result = result?;166 let result = result?;
modifiedcrates/jrsonnet-parser/Cargo.tomldiffbeforeafterboth
4version = "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"
88
9[features]9[features]
10default = []10default = []
14[dependencies]14[dependencies]
15jrsonnet-interner = { path = "../jrsonnet-interner", version = "0.4.2" }15jrsonnet-interner = { path = "../jrsonnet-interner", version = "0.4.2" }
1616
17peg = "0.7.0"17peg = "0.8.0"
1818
19serde = { version = "1.0", features = ["derive", "rc"], optional = true }19serde = { version = "1.0", features = ["derive", "rc"], optional = true }
20gcmodule = { git = "https://github.com/CertainLach/gcmodule", branch = "jrsonnet" }20gcmodule = { git = "https://github.com/CertainLach/gcmodule", branch = "jrsonnet" }
modifiedcrates/jrsonnet-parser/src/lib.rsdiffbeforeafterboth
114 / "\\x" hex_char() hex_char()114 / "\\x" hex_char() hex_char()
115 / ['\\'] (quiet! { ['b' | 'f' | 'n' | 'r' | 't'] / c() } / expected!("<escape character>"))115 / ['\\'] (quiet! { ['b' | 'f' | 'n' | 'r' | 't'] / c() } / expected!("<escape character>"))
116 pub rule string() -> String116 pub rule string() -> String
117 = ['"'] str:$(string_char(<['"']>)*) ['"'] {? unescape::unescape(str).ok_or("<escaped string>")}117 = ['"'] str:$(string_char(<"\"">)*) ['"'] {? unescape::unescape(str).ok_or("<escaped string>")}
118 / ['\''] str:$(string_char(<['\'']>)*) ['\''] {? unescape::unescape(str).ok_or("<escaped string>")}118 / ['\''] str:$(string_char(<"\'">)*) ['\''] {? unescape::unescape(str).ok_or("<escaped string>")}
119 / quiet!{ "@'" str:$(("''" / (!['\''][_]))*) "'" {str.replace("''", "'")}119 / quiet!{ "@'" str:$(("''" / (!['\''][_]))*) "'" {str.replace("''", "'")}
120 / "@\"" str:$(("\"\"" / (!['"'][_]))*) "\"" {str.replace("\"\"", "\"")}120 / "@\"" str:$(("\"\"" / (!['"'][_]))*) "\"" {str.replace("\"\"", "\"")}
121 / string_block() } / expected!("<string>")121 / string_block() } / expected!("<string>")
modifiedcrates/jrsonnet-stdlib/Cargo.tomldiffbeforeafterboth
4version = "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"
88
9[features]9[features]
1010
modifiedcrates/jrsonnet-types/Cargo.tomldiffbeforeafterboth
4version = "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"
88
9[dependencies]9[dependencies]
10peg = "0.7.0"10peg = "0.8.0"
11gcmodule = { git = "https://github.com/CertainLach/gcmodule", branch = "jrsonnet" }11gcmodule = { git = "https://github.com/CertainLach/gcmodule", branch = "jrsonnet" }
1212