You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Joseph Percivall (JIRA)" <ji...@apache.org> on 2016/12/05 17:43:59 UTC
[jira] [Updated] (NIFI-3149) Expression Language should support
passing negative numbers as literals
[ https://issues.apache.org/jira/browse/NIFI-3149?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Joseph Percivall updated NIFI-3149:
-----------------------------------
Status: Patch Available (was: Open)
> Expression Language should support passing negative numbers as literals
> -----------------------------------------------------------------------
>
> Key: NIFI-3149
> URL: https://issues.apache.org/jira/browse/NIFI-3149
> Project: Apache NiFi
> Issue Type: Improvement
> Reporter: Joseph Percivall
> Assignee: Joseph Percivall
> Priority: Trivial
>
> Currently using "${literal(-5.5):toNumber()" will result in an anltr parsing exception due to '-' not being handled in the Lexer[1].
> In the ANTLR lexer, "+" and "-" should be added a potential values at the beginning of a WHOLE_NUMBER or DECIMAL.
> A workaround is to place the number in quotes: ${literal("-5.5"):toNumber()
> [1] https://github.com/apache/nifi/blob/master/nifi-commons/nifi-expression-language/src/main/antlr3/org/apache/nifi/attribute/expression/language/antlr/AttributeExpressionLexer.g#L80-L80
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)