mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-19 19:15:43 +00:00
Partially implement async generators
This commit is contained in:
parent
e9ff68c850
commit
d5b9e6b93a
2 changed files with 60 additions and 3 deletions
|
@ -54,6 +54,9 @@ pub enum CompileErrorType {
|
|||
InvalidContinue,
|
||||
InvalidReturn,
|
||||
InvalidYield,
|
||||
InvalidYieldFrom,
|
||||
InvalidAwait,
|
||||
AsyncYieldFrom,
|
||||
}
|
||||
|
||||
impl CompileError {
|
||||
|
@ -96,6 +99,9 @@ impl fmt::Display for CompileError {
|
|||
CompileErrorType::InvalidContinue => "'continue' outside loop".to_owned(),
|
||||
CompileErrorType::InvalidReturn => "'return' outside function".to_owned(),
|
||||
CompileErrorType::InvalidYield => "'yield' outside function".to_owned(),
|
||||
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(),
|
||||
};
|
||||
|
||||
if let Some(statement) = &self.statement {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue