You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by he...@apache.org on 2020/05/28 20:11:12 UTC
[commons-jexl] 04/04: JEXL-331: document unicode escape sequence
Task #JEXL-331 - Please document \uXXXX escape sequence
This is an automated email from the ASF dual-hosted git repository.
henrib pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-jexl.git
commit c8fd05a5448581f6388aef27e2866da1b0c4438e
Author: henrib <he...@apache.org>
AuthorDate: Thu May 28 22:10:37 2020 +0200
JEXL-331: document unicode escape sequence
Task #JEXL-331 - Please document \uXXXX escape sequence
---
RELEASE-NOTES.txt | 1 +
src/site/xdoc/changes.xml | 3 +++
src/site/xdoc/reference/syntax.xml | 13 +++++++++++--
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index 5523532..6d1bca8 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -75,6 +75,7 @@ New Features in 3.2:
Bugs Fixed in 3.2:
==================
+* JEXL-331: Please document \uXXXX escape sequence
* JEXL-330: JexlException.Parsing.getMessage() throws exception when parse error is in long expression
* JEXL-328: JXLT template scripts evaluation do not process pragmas
* JEXL-327: map[null] does not work in assignment context
diff --git a/src/site/xdoc/changes.xml b/src/site/xdoc/changes.xml
index 784312d..fbf12b5 100644
--- a/src/site/xdoc/changes.xml
+++ b/src/site/xdoc/changes.xml
@@ -26,6 +26,9 @@
</properties>
<body>
<release version="3.2" date="unreleased">
+ <action dev="henrib" type="fix" issue="JEXL-331" due-to="David Costanzo">
+ Please document \uXXXX escape sequence
+ </action>
<action dev="henrib" type="fix" issue="JEXL-330" due-to="David Costanzo">
JexlException.Parsing.getMessage() throws exception when parse error is in long expression
</action>
diff --git a/src/site/xdoc/reference/syntax.xml b/src/site/xdoc/reference/syntax.xml
index 36e784b..720c5a5 100644
--- a/src/site/xdoc/reference/syntax.xml
+++ b/src/site/xdoc/reference/syntax.xml
@@ -346,14 +346,23 @@
Can start and end with either <code>'</code> or <code>"</code> delimiters, e.g.
<code>"Hello world"</code> and
<code>'Hello world'</code> are equivalent.
- <p>The escape character is <code>\</code> (backslash); it only escapes the string delimiter</p>
+ <p>The escape character is <code>\</code> (backslash).
+ Unicode characters can be used in string literals;
+ <lu>Unicode escape sequences consist of:
+ <li> a backslash '\' </li>
+ <li>a 'u' </li>
+ <li>4 hexadecimal digits ([0-9],[A-H],[a-h]).</li>
+ </lu>
+ Such sequences represent the UTF-16 encoding of a Unicode character,
+ for example, <code>'a'</code> is equivalent to <code>'\u0061'</code>.
+ </p>
</td>
</tr>
<tr>
<td>Multiline format literals</td>
<td>
Start and end with <code>`</code> delimiter - back-quote -, e.g. <code>`Hello world`</code>
- <p>The escape character is <code>\</code> (backslash); it only escapes the string delimiter.</p>
+ <p>The escape character is <code>\</code> (backslash); Unicode escape sequences can also be used.</p>
These format literals can span multiple lines and allow Unified JEXL expressions (JSTL like expressions)
to be interpolated. If a variable <code>user</code> valued <code>JEXL</code>is present in the environment - whether
as a local or global variable -, the format <code>`Hello ${user}`</code> will evaluate as <code>Hello JEXL</code>.