I have a custom language in which the following JFlex macro defines the
string literal token:
STRING_LITERAL = \" ( [^
\"\r\n] | "
" )* \"
This appears to work when viewing files which already exist. But when I
am typing new code, I get the following problem:
1. Type opening quote.
2. Type some characters.
3. Type a backslash.
4. Type another character.
5. Type closing quote.
Now, according to the PSI structure (all hail PsiViewer), my language
parser has correctly recognized it as a string literal element. However,
it has not been highlighted as such. The opening and closing quotes as
well as the backslash are marked as bad characters (red/pink background).
However, if I go back and type another character somewhere before the
backslash, the string suddenly highlights as correct. I can also insert
backslashes anywhere inside the string except just before the closing
quote, at which point the highlight reverts to the bad state like I
Any idea what's going on here?
Gordon Tyler (Software Developer)
Quest Software <http://www.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: (416) 933-5046 | Fax: (416) 933-5001