git.delta.rocks / jrsonnet / refs/commits / c93dcb40871d

difftreelog

fix use push_stack_frame in public macroses

Yaroslav Bolyukin2021-01-25parent: #21e57ff.patch.diff
in: master

2 files changed

modifiedcrates/jrsonnet-evaluator/src/function.rsdiffbeforeafterboth
146 ($ctx: expr, $fn_name: expr, $args: expr, $total_args: expr, [146 ($ctx: expr, $fn_name: expr, $args: expr, $total_args: expr, [
147 $($id: expr, $name: ident: $ty: expr $(=>$match: path)?);+ $(;)?147 $($id: expr, $name: ident: $ty: expr $(=>$match: path)?);+ $(;)?
148 ], $handler:block) => {{148 ], $handler:block) => {{
149 use $crate::{error::Error::*, throw, evaluate, push, typed::CheckType};149 use $crate::{error::Error::*, throw, evaluate, push_stack_frame, typed::CheckType};
150150
151 let args = $args;151 let args = $args;
152 if args.len() > $total_args {152 if args.len() > $total_args {
162 throw!(IntrinsicArgumentReorderingIsNotSupportedYet);162 throw!(IntrinsicArgumentReorderingIsNotSupportedYet);
163 }163 }
164 }164 }
165 let $name = push(None, || format!("evaluating argument"), || {165 let $name = push_stack_frame(None, || format!("evaluating argument"), || {
166 let value = evaluate($ctx.clone(), &$name.1)?;166 let value = evaluate($ctx.clone(), &$name.1)?;
167 $ty.check(&value)?;167 $ty.check(&value)?;
168 Ok(value)168 Ok(value)
modifiedcrates/jrsonnet-evaluator/src/typed.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/typed.rs
+++ b/crates/jrsonnet-evaluator/src/typed.rs
@@ -11,8 +11,8 @@
 #[macro_export]
 macro_rules! unwrap_type {
 	($desc: expr, $value: expr, $typ: expr => $match: path) => {{
-		use $crate::{push, typed::CheckType};
-		push(None, $desc, || Ok($typ.check(&$value)?))?;
+		use $crate::{push_stack_frame, typed::CheckType};
+		push_stack_frame(None, $desc, || Ok($typ.check(&$value)?))?;
 		match $value {
 			$match(v) => v,
 			_ => unreachable!(),