mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-08 05:35:22 +00:00
Pass more information in user defined parse error
This commit is contained in:
parent
e14ac0ce39
commit
f4a94903b3
1 changed files with 4 additions and 1 deletions
|
@ -56,7 +56,10 @@ impl fmt::Display for CompileError {
|
|||
}?;
|
||||
|
||||
// Print line number:
|
||||
write!(f, " at line {:?}", self.location.row())
|
||||
match &self.error {
|
||||
CompileErrorType::Parse(..) => Ok(()),
|
||||
_ => write!(f, " at line {:?}", self.location.row()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue