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
--- a/crates/jrsonnet-evaluator/src/function.rs
+++ b/crates/jrsonnet-evaluator/src/function.rs
@@ -146,7 +146,7 @@
 	($ctx: expr, $fn_name: expr, $args: expr, $total_args: expr, [
 		$($id: expr, $name: ident: $ty: expr $(=>$match: path)?);+ $(;)?
 	], $handler:block) => {{
-		use $crate::{error::Error::*, throw, evaluate, push, typed::CheckType};
+		use $crate::{error::Error::*, throw, evaluate, push_stack_frame, typed::CheckType};
 
 		let args = $args;
 		if args.len() > $total_args {
@@ -162,7 +162,7 @@
 					throw!(IntrinsicArgumentReorderingIsNotSupportedYet);
 				}
 			}
-			let $name = push(None, || format!("evaluating argument"), || {
+			let $name = push_stack_frame(None, || format!("evaluating argument"), || {
 				let value = evaluate($ctx.clone(), &$name.1)?;
 				$ty.check(&value)?;
 				Ok(value)
modifiedcrates/jrsonnet-evaluator/src/typed.rsdiffbeforeafterboth
11#[macro_export]11#[macro_export]
12macro_rules! unwrap_type {12macro_rules! unwrap_type {
13 ($desc: expr, $value: expr, $typ: expr => $match: path) => {{13 ($desc: expr, $value: expr, $typ: expr => $match: path) => {{
14 use $crate::{push, typed::CheckType};14 use $crate::{push_stack_frame, typed::CheckType};
15 push(None, $desc, || Ok($typ.check(&$value)?))?;15 push_stack_frame(None, $desc, || Ok($typ.check(&$value)?))?;
16 match $value {16 match $value {
17 $match(v) => v,17 $match(v) => v,
18 _ => unreachable!(),18 _ => unreachable!(),