V4.2: Syntax highlighting for nested quotes
Submitted by Tuesday, 7 December, 2004 - 12:37
on
Hello everyone,
I am a new user to jEdit and love it. However, I am having a problem trying set up the SPAN/SPAN_REGEXP to handle nested quotes. The language I am trying to handle is an implementation of Lua (CELX scripting for the open source program Celestia), and allows the double and single quotes to be included in strings using a backslash (e.g.
text = "the \" character is a quotation mark"
more = "hello"
The default rules for Lua highlight would cause - "the \" - to be higlighted as quoted, - character is a quotation mark - to be treated as code and - " more = " to be highlighted as quotes.
Essentially, I need to jEdit to recognise that " and ' are only quotes if they are not preceeded by a \. I tried using SPAN_REGEXP. This worked for recognising the opening quotes, but since the tag is not evaluated as a regular expression, I could find no way to get it to skip occurences of \" and \'.
Does anyone know of a way to do this?
Thank you.