Does anyone understand JDE's Java font lock mode (which I believe is
derived from andersl) well enough to help me with the following?
I often use the following style in method headers to highlight the fact
that a method can return null:
public String /* or null */ getProperty (String key) {
if ( properties == null )
try {
properties = new Properties();
properties.load(Collagen.class.getResourceAsStream("/properties"));
} catch (IOException e) { System.err.println(e); }
return properties.getProperty(key);
}
Unfortunately, the method name in this case does not get colorized properly.
It seems to me that it would be generally correct for _all_ the regular expressions
to allow arbitrary /*...*/ comments between tokens. However, I would settle
for a single fix to this case.
Thanks in advance. -CR
P.S. While I have the ear of someone who knows these regular expressions inside
out, there is another small extension I could use help with:
I am using a preprocessor to make a few simple extensions to the Java syntax
in which:
(1) I have a number of keywords, such as "myclass" and "hisclass",
which are used syntactically the same as "class", and I would like them
to be colorized the same as "class", e.g.,
public myclass Foo {
...
}
public hisclass Bar {
...
}
(2) I have a number of keywords, such as "myprivate" and "hisprivate",
which are used syntactically the same as "private", and I would like them
to be colorized the same as "private", e.g.,
public myclass Foo {
myprivate int i;
hisprivate float f;
...
}
Can someone tell me where in the maze of regexp's I can add "myclass",
"hisclass", and "myfield", "hisfield" to get the appropriate effect?
Btw, I notice there is already a provision for
java-font-lock-extra-types. Maybe the general way to do this would be
to add java-font-lock-extra-type-keywords and
java-font-lock-extra-type-specs ?
Thanks, -CR
--
Charles Rich | Mitsubishi Electric Research Laboratory (MERL)
617-621-7507 phone | 201 Broadway
617-621-7550 fax | Cambridge, MA 02139
[EMAIL PROTECTED] | http://www.merl.com