[fine] Note about panics and error messages
This commit is contained in:
parent
c4b4273115
commit
2ba34701ac
1 changed files with 7 additions and 0 deletions
|
|
@ -177,6 +177,13 @@ impl<'a> Compiler<'a> {
|
||||||
where
|
where
|
||||||
T: Into<String>,
|
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());
|
let index = self.add_string(description.into());
|
||||||
Instruction::Panic(index)
|
Instruction::Panic(index)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue