Add an Ast::list function analogue to Ast::symbol

pull/3/head
itycodes 2 weeks ago
parent c6da0d4902
commit d8d4f0ee89

@ -148,6 +148,13 @@ impl Ast {
}
}
pub fn list(self) -> Option<Vec<Ast>> {
match self {
Ast::List(Localised { item, .. }) => Some(item),
_ => None,
}
}
pub fn location(&self) -> &Location {
match self {
Ast::Symbol(Localised { location, .. }) => location,

Loading…
Cancel
Save