Struct erg_compiler::hir::Args
source · pub struct Args {
pub pos_args: Vec<PosArg>,
pub var_args: Option<Box<PosArg>>,
pub kw_args: Vec<KwArg>,
pub paren: Option<(Token, Token)>,
}
Fields§
§pos_args: Vec<PosArg>
§var_args: Option<Box<PosArg>>
§kw_args: Vec<KwArg>
§paren: Option<(Token, Token)>
Implementations§
source§impl Args
impl Args
pub fn new( pos_args: Vec<PosArg>, var_args: Option<PosArg>, kw_args: Vec<KwArg>, paren: Option<(Token, Token)> ) -> Self
pub fn values(exprs: Vec<Expr>, paren: Option<(Token, Token)>) -> Self
pub fn empty() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn kw_len(&self) -> usize
pub fn push_pos(&mut self, pos: PosArg)
pub fn push_kw(&mut self, kw: KwArg)
pub fn remove(&mut self, index: usize) -> Expr
sourcepub fn try_remove(&mut self, index: usize) -> Option<Expr>
pub fn try_remove(&mut self, index: usize) -> Option<Expr>
try_remove((1, 2, z: 3), 2) == Some(3)
pub fn try_remove_pos(&mut self, index: usize) -> Option<PosArg>
pub fn try_remove_kw(&mut self, index: usize) -> Option<KwArg>
pub fn get(&self, index: usize) -> Option<&Expr>
pub fn remove_left_or_key(&mut self, key: &str) -> Option<Expr>
pub fn get_left_or_key(&self, key: &str) -> Option<&Expr>
pub fn get_mut_left_or_key(&mut self, key: &str) -> Option<&mut Expr>
pub fn insert_pos(&mut self, idx: usize, pos: PosArg)
Trait Implementations§
source§impl Locational for Args
impl Locational for Args
source§fn loc(&self) -> Location
fn loc(&self) -> Location
NOTE:
loc
cannot be treated as a light method when self
is a large grammatical element.
If possible, delay the computation by passing &impl Locational
or other means.