This commit is contained in:
Erin 2023-07-12 01:24:41 +02:00 committed by ondra05
parent cf05464c14
commit 51e0db9c7d

View file

@ -88,7 +88,7 @@ macro_rules! gen_text {
match op { match op {
$( $(
$(hbbytecode::opcode::$opcode)|* => paste::paste!({ $(hbbytecode::opcode::$opcode)|* => paste::paste!({
param_extract_iim!(lexer, $($param_i: $param_ty),*); param_extract_itm!(lexer, $($param_i: $param_ty),*);
asm.[<i_param_ $ityn>](op, $($param_i),*); asm.[<i_param_ $ityn>](op, $($param_i),*);
}), }),
)* )*
@ -135,14 +135,14 @@ macro_rules! extract {
}; };
} }
macro_rules! param_extract_iim { macro_rules! param_extract_itm {
($lexer:expr, $($id:ident: $ty:ident)? $(, $($tt:tt)*)?) => { ($lexer:expr, $($id:ident: $ty:ident)? $(, $($tt:tt)*)?) => {
$(extract!($lexer, $ty, $id);)? $(extract!($lexer, $ty, $id);)?
$( $(
extract_pat!($lexer, Token::PSep); extract_pat!($lexer, Token::PSep);
param_extract_iim!($lexer, $($tt)*); param_extract_itm!($lexer, $($tt)*);
)? )?
}; };
} }
pub(crate) use {extract, extract_pat, gen_text, param_extract_iim}; pub(crate) use {extract, extract_pat, gen_text, param_extract_itm};