Skip to content

Commit

Permalink
Merge pull request #137 from CertainLach/fix-async-imports
Browse files Browse the repository at this point in the history
fix: make `async_imports` compile again
  • Loading branch information
CertainLach authored Oct 29, 2023
2 parents e5639a3 + e65c4a7 commit fd582d4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions crates/jrsonnet-evaluator/src/async_import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use jrsonnet_parser::{
SourcePath,
};

use crate::{gc::GcHashMap, throw, FileData, ImportResolver, State};
use crate::{bail, gc::GcHashMap, FileData, ImportResolver, State};

pub struct Import {
path: IStr,
Expand Down Expand Up @@ -179,9 +179,11 @@ pub fn find_imports(expr: &LocExpr, out: &mut FoundImports) {
find_imports(expr, out);
in_args(args, out);
}
Expr::Index(expr, index) => {
find_imports(expr, out);
find_imports(index, out);
Expr::Index { indexable, parts } => {
find_imports(indexable, out);
for part in parts {
find_imports(&part.value, out);
}
}
Expr::Function(params, expr) => {
in_params(params, out);
Expand Down Expand Up @@ -262,7 +264,7 @@ impl ImportResolver for ResolvedImportResolver {
}

fn resolve(&self, path: &Path) -> crate::Result<SourcePath> {
throw!(crate::error::ErrorKind::AbsoluteImportNotSupported(
bail!(crate::error::ErrorKind::AbsoluteImportNotSupported(
path.to_owned()
))
}
Expand Down

0 comments on commit fd582d4

Please sign in to comment.