Yield as contextual keyword (was: Call for bikeshed -- break replacement in expression switch)

John Rose john.r.rose at oracle.com
Mon May 20 19:52:23 UTC 2019

On May 20, 2019, at 8:24 AM, Tagir Valeev <amaembo at gmail.com> wrote:
> Assuming that we agreed on 'yield' the option B seems the most attractive. A big No to context-specific parse tree. It's a complete pain to IDEs. Don't forget that IDE often deals with incomplete code, missing dependencies, etc., and still needs to provide reasonable highlighting and completion. Imagine that 'yield' method is available via import static Foo.* or superclass. In this case we don't want to look into other files to build a correct parse tree.

So does this (option B plus your No) mean that IDEs would 
tend to color "yield" as a keyword (at the beginning of a
statement) even if followed by "("?

I suppose that would work.  It's hard to predict what that
would feel like, but it's logical.

— John

More information about the amber-spec-experts mailing list