Skip to content

(java) switch expression keywords #3647

@MBoegers

Description

@MBoegers

Describe the issue
JEP 361: Switch Expressions intruduces new keywords ´yield´ to Java in context of ´switch´ but ´yield´ is not rendered as such.

Which language seems to have the issue?
Java, language is set fixed.

Are you using highlight or highlightAuto?
I use hightlight via asciidoc reveal.js

Sample Code to Reproduce

switch(a) {
 case Object -> yield 1;
}

Expected behavior

<span class="hljs-keyword">switch</span>(a) {
 <span class="hljs-keyword">case</span> Object -&gt; <span class="hljs-keyword">yield</span> <span class="hljs-number">1</span>;
}

Additional context
´yield´ is a contextual keyword, this means it can be a normal identifier in Java. It is a keyword within the switch expression, see JLS 3.9. Keywords

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy