Skip to content

Commit

Permalink
Fix bug in module index searching.
Browse files Browse the repository at this point in the history
  • Loading branch information
schungx committed Sep 22, 2023
1 parent 01c09be commit 4ebfc62
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/parser.rs
Expand Up @@ -221,6 +221,7 @@ impl<'e, 's> ParseState<'e, 's> {
pub fn find_module(&self, name: &str) -> Option<NonZeroUsize> {
self.imports
.iter()
.rev()
.rposition(|n| n.as_str() == name)
.and_then(|i| NonZeroUsize::new(i + 1))
}
Expand Down

0 comments on commit 4ebfc62

Please sign in to comment.