Fix syntax error tests

This commit is contained in:
Noah 2020-03-05 00:57:05 -06:00
parent d5b9e6b93a
commit 7d6d5ff907
4 changed files with 12 additions and 29 deletions

View file

@ -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 {