[fine] Note about panics and error messages

This commit is contained in:
John Doty 2024-03-24 07:48:23 -07:00
parent c4b4273115
commit 2ba34701ac

View file

@ -177,6 +177,13 @@ impl<'a> Compiler<'a> {
where
T: Into<String>,
{
// TODO: We should be looking for semantic errors and using *those*
// as the panic description and only fall back to the provided
// description if we can't find a semantic error. The idea is
// that if the compiler got confused it *might* be because
// there was actually a semantic error in the program and that
// semantic error might be a better description of what is
// wrong.
let index = self.add_string(description.into());
Instruction::Panic(index)
}