petr_resolve/
lib.rs

1//! given bindings, fully resolve an AST
2//! This crate's job is to tee up the type checker for the next stage of compilation.
3
4pub use petr_ast::{Intrinsic as IntrinsicName, Literal, Ty};
5pub use petr_bind::Dependency;
6use petr_utils::{SpannedItem, SymbolInterner};
7pub use resolved::QueryableResolvedItems;
8use resolver::Resolver;
9pub use resolver::{Expr, ExprKind, Function, FunctionCall, Intrinsic, ResolutionError, Type};
10
11mod resolved;
12mod resolver;
13
14pub fn resolve_symbols(
15    ast: petr_ast::Ast,
16    interner: SymbolInterner,
17    dependencies: Vec<Dependency>,
18) -> (Vec<SpannedItem<ResolutionError>>, QueryableResolvedItems) {
19    let resolver = Resolver::new(ast, interner, dependencies);
20    resolver.into_queryable()
21}