Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.1
-
None
Description
WHAT
Introduce a new operator, the unary plus as in '+4' or '+b' expressions. JEXL arithmetic already allows using a unary minus operator (the negate operation) so there is logic in having the counterpart.
The proposed default behaviour would be to:
- call the 'Math.abs(...)' method for numbers
- return true for boolean
- could uppercase strings ? (should '-' lowercase strings ??)
HOW
- Follow the unary minus syntax and construct in the .jjt / ASTUnaryPlus / ParserVisitor
- Implement Interpreter, Debugger
- Implement abs in JexlArithmetic
Attachments
Issue Links
- relates to
-
JEXL-293 leading plus sign not recognized
- Closed