Closed dfa1 closed 5 years ago
Maybe I was to quick here: It seems var
is used as an identifier in the example files on https://github.com/rubychan/coderay-scanner-tests, for example https://raw.githubusercontent.com/rubychan/coderay-scanner-tests/master/java/jruby.in.java:
public static IRubyObject trace_var(…) {
…
String var = args.length > 1 ? args[0].toString() : null;
Here, highlighting var
as a type seems wrong. CodeRay can't know which version of Java the code is targeting, so it might be better to leave this word alone.
Hello,
it would be nice to support the new Java type inference "var". According to the spec [1] "var" is not a keyword but rather a special type identifier.
This is why I added var to TYPES rather than to KEYWORDS.
[1] see section "3.9" of The Java Language Specification, Java SE 11 Edition (https://docs.oracle.com/javase/specs/jls/se11/html/jls-3.html#jls-3.9)