Pull requests

#243 Merged
Repository
picomancer
Branch
default
Repository
birkenfeld
Branch
default

java: Decrease priority of method regex to avoid parsing 'else if (' as method

Author
  1. picomancer
Reviewers
Description

"else if" is incorrectly highlighted in Java. I discovered it while writing a blog post at http://picomancer.com/blog/indentation-vs-braces-to-delimit-blocks/ but you don't even need to click on the link, you can see the breakage live on Bitbucket in the following snippet -- because, apparently, Bitbucket itself uses Pygments for highlighting:

if (a)
    alpha();
else if (b)
    beta();
else
    gamma();

It looks like other lexers in that source file may be affected. "else if" is valid in most C-like languages, so this may affect a ton of other lexers!

  • Learn about pull requests

Comments (1)