Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Escape backslash quotes in string in user defined language

    Help wanted · · · – – – · · ·
    2
    2
    4930
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Z
      Zertdubitfo last edited by

      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

      1 Reply Last reply Reply Quote 1
      • Jan Schreiber
        Jan Schreiber last edited by

        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”.

        1 Reply Last reply Reply Quote 1
        • First post
          Last post
        Copyright © 2014 NodeBB Forums | Contributors