Further attempts at refactoring the error handling code

* Everything's still broken though
This commit is contained in:
Emmanuel BENOîT 2023-01-04 07:35:40 +01:00
parent 0443754007
commit 7961a92ad1
6 changed files with 99 additions and 59 deletions

View file

@ -8,7 +8,7 @@ use crate::{
pub type ResolvedVariables = HashMap<*const ast::ExprNode, usize>;
pub fn resolve_variables(program: &ast::ProgramNode) -> Result<ResolvedVariables, SloxError> {
pub fn resolve_variables(program: &ast::ProgramNode) -> SloxResult<ResolvedVariables> {
let mut state = ResolverState::default();
program.resolve(&mut state).map(|_| state.resolved)
}