You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/12/05 17:43:59 UTC

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=15722836#comment-15722836 ] 

ASF GitHub Bot commented on NIFI-3149:
--------------------------------------

GitHub user JPercivall opened a pull request:

    https://github.com/apache/nifi/pull/1298

    NIFI-3149 Adding proper literal support for number operators ('-' and…

    … '+') to ANTLR parser and UI highlighting

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/JPercivall/nifi NIFI-3149

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi/pull/1298.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1298
    
----
commit 2b12e3eb9d05393c48b0f3df1ea750aab7818c68
Author: jpercivall <jp...@apache.org>
Date:   2016-12-05T17:37:52Z

    NIFI-3149 Adding proper literal support for number operators ('-' and '+') to ANTLR parser and UI highlighting

----


> 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)