Skip to content

Commit

Permalink
Revert "move lowering stage after validation"
Browse files Browse the repository at this point in the history
This reverts commit ad2286e.
  • Loading branch information
mhasel committed Oct 28, 2024
1 parent e8ac9aa commit 5ffea13
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions compiler/plc_driver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,24 +277,18 @@ pub fn compile_with_options(compile_options: CompilationContext) -> Result<()> {
// 1. Parse, 2. Index and 3. Resolve / Annotate
let annotated_project = pipelines::ParsedProject::parse(&ctxt, project, &mut diagnostician)?
.index(ctxt.provider())
.annotate(ctxt.provider());

// 4. Validate
annotated_project.validate(&ctxt, &mut diagnostician).map_err(|e| {
if compile_parameters.output_ast {
println!("{:#?}", annotated_project.units);
}
e
})?;

// 5. AST-lowering, re-index and re-resolve
let annotated_project = annotated_project.lower(ctxt.provider());
.annotate(ctxt.provider())
// 4. AST-lowering, re-index and re-resolve
.lower(ctxt.provider());

if compile_parameters.output_ast {
println!("{:#?}", annotated_project.units);
return Ok(());
}

// 5. Validate
annotated_project.validate(&ctxt, &mut diagnostician)?;

if let Some((location, format)) =
compile_parameters.hardware_config.as_ref().zip(compile_parameters.config_format())
{
Expand Down

0 comments on commit 5ffea13

Please sign in to comment.