Added support for defining macros in Rust within the macro system
Also fixed a lot of bugs
This commit is contained in:
@@ -48,13 +48,15 @@ pub async fn absolute_path(
|
||||
) -> Result<VName, AbsPathError> {
|
||||
let i_self = i.i("self").await;
|
||||
let i_super = i.i("super").await;
|
||||
let relative = rel.first().is_some_and(|s| *s != i_self && *s != i_super);
|
||||
if let Some((_, tail)) = rel.split_first().filter(|(h, _)| **h != i_self) {
|
||||
let mut relative = false;
|
||||
if let Some((_, tail)) = rel.split_first().filter(|(h, _)| **h == i_self) {
|
||||
rel = tail;
|
||||
relative = true;
|
||||
} else {
|
||||
while let Some((_, tail)) = rel.split_first().filter(|(h, _)| **h == i_super) {
|
||||
cwd = cwd.split_last().ok_or(AbsPathError::TooManySupers)?.1;
|
||||
rel = tail;
|
||||
relative = true;
|
||||
}
|
||||
}
|
||||
if relative { VName::new(cwd.iter().chain(rel).cloned()) } else { VName::new(rel.to_vec()) }
|
||||
|
||||
Reference in New Issue
Block a user