Add a conversion from our high-level IR to a lower-level one.

This commit is contained in:
2022-02-24 21:18:30 -08:00
parent 9d82c8ca2d
commit dcc6562050
9 changed files with 332 additions and 37 deletions

View File

@@ -159,17 +159,15 @@ impl From<Error> for Diagnostic<usize> {
},
Error::UnboundVariable(location, name) => match location {
Location::Manufactured => Diagnostic::error().with_message(format!(
"Unbound variable '{}'",
name
)),
Location::Manufactured => {
Diagnostic::error().with_message(format!("Unbound variable '{}'", name))
}
Location::InFile(file_id, offset) => Diagnostic::error()
.with_labels(vec![
Label::primary(*file_id, *offset..*offset).with_message("unbound here")
])
.with_message(format!("Unbound variable '{}'", name)),
}
},
}
}
}