mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-21 12:05:27 +00:00
Fix syntax error tests
This commit is contained in:
parent
d5b9e6b93a
commit
7d6d5ff907
4 changed files with 12 additions and 29 deletions
|
@ -57,6 +57,7 @@ pub enum CompileErrorType {
|
|||
InvalidYieldFrom,
|
||||
InvalidAwait,
|
||||
AsyncYieldFrom,
|
||||
AsyncReturnValue,
|
||||
}
|
||||
|
||||
impl CompileError {
|
||||
|
@ -102,6 +103,9 @@ impl fmt::Display for CompileError {
|
|||
CompileErrorType::InvalidYieldFrom => "'yield from' outside function".to_owned(),
|
||||
CompileErrorType::InvalidAwait => "'await' outside async function".to_owned(),
|
||||
CompileErrorType::AsyncYieldFrom => "'yield from' inside async function".to_owned(),
|
||||
CompileErrorType::AsyncReturnValue => {
|
||||
"'return' with value inside async generator".to_owned()
|
||||
}
|
||||
};
|
||||
|
||||
if let Some(statement) = &self.statement {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue