Parse contextual dyn keyword properly in edition 2015

This commit is contained in:
Lukas Wirth 2024-07-19 20:20:00 +02:00
parent 9fd6c695da
commit f4199f786e
10 changed files with 164 additions and 11 deletions

View file

@ -65,9 +65,8 @@ pub(crate) fn to_parser_input<S: Copy + fmt::Debug>(
i if i.starts_with('\'') => res.push(LIFETIME_IDENT),
_ if ident.is_raw.yes() => res.push(IDENT),
"gen" if !edition.at_least_2024() => res.push(IDENT),
"async" | "await" | "dyn" | "try" if !edition.at_least_2018() => {
res.push(IDENT)
}
"dyn" if !edition.at_least_2018() => res.push_ident(DYN_KW),
"async" | "await" | "try" if !edition.at_least_2018() => res.push(IDENT),
text => match SyntaxKind::from_keyword(text) {
Some(kind) => res.push(kind),
None => {