Remove some macros (#12742)

# Description
Replaces some macros with regular functions or other code.
This commit is contained in:
Ian Manske
2024-05-03 08:35:37 +00:00
committed by GitHub
parent eff2f1b3b0
commit f32ecc641f
5 changed files with 220 additions and 302 deletions

View File

@ -36,6 +36,15 @@ impl Argument {
Argument::Spread(e) => e.span,
}
}
pub fn expr(&self) -> Option<&Expression> {
match self {
Argument::Named((_, _, expr)) => expr.as_ref(),
Argument::Positional(expr) | Argument::Unknown(expr) | Argument::Spread(expr) => {
Some(expr)
}
}
}
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]