henrib commented on code in PR #397:
URL: https://github.com/apache/commons-jexl/pull/397#discussion_r2763996643
##########
src/main/java/org/apache/commons/jexl3/internal/TemplateEngine.java:
##########
@@ -1086,54 +1086,56 @@ TemplateExpression parseExpression(final JexlInfo info,
final String expr, final
// nested immediate in deferred; need to balance count of '{'
& '}'
// closing '}'
switch (c) {
- case '"':
- case '\'':
- strb.append(c);
- column = StringParser.readString(strb, expr, column + 1,
c);
- continue;
- case '{':
- if (expr.charAt(column - 1) == immediateChar) {
- inner1 += 1;
- strb.deleteCharAt(strb.length() - 1);
- nested = true;
- } else {
- deferred1 += 1;
- strb.append(c);
- }
- continue;
- case '}':
- // balance nested immediate
- if (deferred1 > 0) {
- deferred1 -= 1;
+ case '"':
+ case '\'':
strb.append(c);
- } else if (inner1 > 0) {
- inner1 -= 1;
- } else {
- // materialize the nested/deferred expr
- final String src = escapeString(strb);
- final JexlInfo srcInfo = info.at(lineno, column);
- TemplateExpression dexpr;
- if (nested) {
- dexpr = new NestedExpression(
- escapeString(expr.substring(inested,
column + 1)),
+ column = StringParser.readString(strb, expr, column +
1, c);
+ continue;
+ case '{':
+ if (expr.charAt(column - 1) == immediateChar) {
+ inner1 += 1;
+ strb.deleteCharAt(strb.length() - 1);
+ nested = true;
+ } else {
+ deferred1 += 1;
+ strb.append(c);
+ }
+ continue;
Review Comment:
No, the sequence for (inner) expression is $ immediately followed by { -
'${' or '#{' in the default case -, there is no ignorable character to consider
here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]