mod future_checker;
mod await_checker;
use self::await_checker::AwaitChecker;
mod expression;
mod statement;
mod program;
mod visitor;
use visitor::*;
use crate::Pass;
use leo_ast::ProgramVisitor;
use leo_errors::Result;
use leo_span::Symbol;
pub struct StaticAnalyzing;
impl Pass for StaticAnalyzing {
type Input = ();
type Output = ();
const NAME: &str = "StaticAnalyzing";
fn do_pass(_input: Self::Input, state: &mut crate::CompilerState) -> Result<Self::Output> {
let ast = std::mem::take(&mut state.ast);
let mut visitor = StaticAnalyzingVisitor {
state,
await_checker: AwaitChecker::new(),
current_program: Symbol::intern(""),
variant: None,
non_async_external_call_seen: false,
};
visitor.visit_program(ast.as_repr());
visitor.state.handler.last_err().map_err(|e| *e)?;
visitor.state.ast = ast;
Ok(())
}
}