SwiftSyntax not recognizing async/await keywords

AFAIK, for source compatibility reasons, most new "keywords" are actually contextual keywords that are lexed as identifiers that the parser inspects the contents of, instead of the lexer treating them as unique keyword kinds. If they introduced a new keyword as a keyword token, it would break source compatibility anywhere that that word was used as an identifier; for example let await = true would fail.

I'm not sure why override is included in that set since it's not a new keyword, but maybe they just didn't want to exclude it from being an identifier everywhere else since it's only used as a callable decl modifier.

1 Like