Uploaded image for project: 'Commons JEXL'
  1. Commons JEXL
  2. JEXL-331

Please document \uXXXX escape sequence

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.1
    • 3.2
    • None
    • N/A

    Description

      One of my JEXL programmers discovered an undocumented feature of JEXL that they could use the Java-style \uXXXX escape sequence in string literals (this might be JEXL-22). This is useful enough to be worth documenting.

      It's not clear to me if the \uXXXX sequences can only be used within string literals (as in C) or anywhere in a JEXL script (as in Java).  I tried creating a JEXL string literal that used \u0027 instead of a single quote as its delimiter, but it didn't work, so I suspect this is just for string literals.

      For reference, the escape sequences are documented under "String literals" in syntax.xml like this:

      <p>The escape character is <code>\</code> (backslash); it only escapes the string delimiter</p>

      By the way, the second clause is not strictly true, since (experimentally) the escape character can also be escaped (this might be JEXL-98). This might be obvious enough that it doesn't need to be documented, though.

      Attachments

        Activity

          People

            henrib Henri Biestro
            david_costanzo David Costanzo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: