Add Java 10 `var` keyword

#742 Open

Bitbucket cannot automatically merge this request.

The commits that make up this pull request have been removed.

Bitbucket cannot automatically merge this request due to conflicts.

Review the conflicts on the Overview tab. You can then either decline the request or merge it manually on your local system using the following commands:

hg update default
hg pull -r Icyene/add-java-10-var-keyword-1511765061417
hg merge Icyene/add-java-10-var-keyword-1511765061417
hg commit -m 'Merged in Icyene/pygments-main/Icyene/add-java-10-var-keyword-1511765061417 (pull request #742)'
  1. Tudor Brinedus

Add Java 10 var keyword

Comments (3)

  1. Tudor Brinedus author

    This implements issue #1397.

    I suppose the ideal scenario would be highlighting it only when it is used as a variable type and not as a name. This would match the "context-sensitive" part of the JEP, but I don't think this detail is important nor trivial to implement.

  2. Nicola Atzei

    Hi @Tudor Brinedus . To have a “context-sensitive” parsing you could add (after reverting your change):

    (r'(var)(\s+)', bygroups(Keyword.Declaration, Text), 'var'),


    'var' : [
        (r'([^\W\d]|\$)[\w$]*', Name, '#pop')

    I’m interested in this PR. Please update it :)

    Thank you