From c93dcb40871de02802bfcd907cc86db6dc0daf86 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Mon, 25 Jan 2021 05:51:08 +0300 Subject: [PATCH] fix: use push_stack_frame in public macroses Signed-off-by: Yaroslav Bolyukin --- crates/jrsonnet-evaluator/src/function.rs | 4 ++-- crates/jrsonnet-evaluator/src/typed.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/jrsonnet-evaluator/src/function.rs b/crates/jrsonnet-evaluator/src/function.rs index 05affc3d..1c3f317e 100644 --- a/crates/jrsonnet-evaluator/src/function.rs +++ b/crates/jrsonnet-evaluator/src/function.rs @@ -146,7 +146,7 @@ macro_rules! parse_args { ($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 @@ macro_rules! parse_args { 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) diff --git a/crates/jrsonnet-evaluator/src/typed.rs b/crates/jrsonnet-evaluator/src/typed.rs index 61ea7d06..8afd704e 100644 --- a/crates/jrsonnet-evaluator/src/typed.rs +++ b/crates/jrsonnet-evaluator/src/typed.rs @@ -11,8 +11,8 @@ use thiserror::Error; #[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!(),