Skip to content

Commit

Permalink
Clarify the current escaping rules as discussed in #39
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Thomas <markt@apache.org>
  • Loading branch information
markt-asf committed Jan 30, 2020
1 parent 2dd063e commit b065527
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions spec/src/main/asciidoc/ELSpec.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -478,10 +478,14 @@ floating point, string, and null in an eval-expression.
`FloatingPointLiteral` construct in link:ELSpec.html#a524[Collected
Syntax]

* String - With single and double quotes - `"`
is escaped as `\"`, `'` is escaped as `\'`, and `\` is escaped as `\\`.
Quotes only need to be escaped in a string value enclosed in the same
type of quote
* String - Enclosed with single or double quotes with the following rules
for escaping the enclosed string:
** `\` must be escaped as `\\`
** `"` must be escaped as `\"` when the string is enclosed with `"`
** `"` may be escaped as `\"` when the string is enclosed with `'`
** `'` must be escaped as `\'` when the string is enclosed with `'`
** `'` may be escaped as `\'` when the string is enclosed with `"`
** no other escaping is permitted

* Null - `null`

Expand Down

0 comments on commit b065527

Please sign in to comment.