Escape backslash quotes in string in user defined language

  • Hi all,
    I try to write a user defined language for Groovy (in fact just an improvement of one found on the web).

    Groovy’ strings delimiter can be either ’ (single quote) or " (double).
    You can escape a single quote within a string delimited by single quotes.

    For example, you can have : ‘blah blah’ blah blah’.
    My problem is that the escaped quotes ’ is always detected as end of the string.
    So the last single quote is interpreted as the start of a new string which imply the highlighting is wrong for the reste of the file.

    Is there any way in a user defined language to exclude ’ as string delimiter when ’ is a string delimiter ?

    Thank you in adance for your help

  • In the UDL dialog, click the “Operators and Delimiters” tab. Under the caption “Delimiter 1” add the double quotation mark " as both “Open” and “Close”, the backslash as “Escape”. Same for the single quotation mark under “Delimiter 2”.

Log in to reply