Skip to content

Commit 633e8e0

Browse files
committed
refactor: expose popn macros
1 parent be7e9a5 commit 633e8e0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/interpreter/src/instructions/macros.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ macro_rules! resize_memory {
127127
};
128128
}
129129

130+
/// Pops n values from the stack. Fails the instruction if n values can't be popped.
131+
#[macro_export]
130132
macro_rules! popn {
131133
([ $($x:ident),* ],$interpreterreter:expr $(,$ret:expr)? ) => {
132134
let Some([$( $x ),*]) = $interpreterreter.stack.popn() else {
@@ -136,6 +138,8 @@ macro_rules! popn {
136138
};
137139
}
138140

141+
/// Pops n values from the stack and returns the top value. Fails the instruction if n values can't be popped.
142+
#[macro_export]
139143
macro_rules! popn_top {
140144
([ $($x:ident),* ], $top:ident, $interpreterreter:expr $(,$ret:expr)? ) => {
141145
let Some(([$( $x ),*], $top)) = $interpreterreter.stack.popn_top() else {

0 commit comments

Comments
 (0)