[jboss-jira] [JBoss JIRA] (DROOLS-4812) DMN FEEL warn if en-dash is present as a character in expression

Toshiya Kobayashi (Jira) issues at jboss.org
Mon Dec 9 03:23:00 EST 2019


     [ https://issues.redhat.com/browse/DROOLS-4812?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Toshiya Kobayashi updated DROOLS-4812:
--------------------------------------
    Labels:   (was: good-first-issue)


> DMN FEEL warn if en-dash is present as a character in expression
> ----------------------------------------------------------------
>
>                 Key: DROOLS-4812
>                 URL: https://issues.redhat.com/browse/DROOLS-4812
>             Project: Drools
>          Issue Type: Enhancement
>          Components: dmn engine
>            Reporter: Matteo Mortari
>            Assignee: Matteo Mortari
>            Priority: Major
>
> This is taken from the DMN spec :
> {code:java}
> (amount *rate/12) / (1 – (1 + rate/12)**-term)
> {code}
> however this would fail to parse correctly as the first subtraction sign is an "en-dash" (0x2013) and not a minus/hyphen sign (0x2D)
> {code:java}
> (amount *rate/12) / (1 – (1 + rate/12)**-term)
>                        ^ 
> (amount *rate/12) / (1 - (1 + rate/12)**-term)
> {code}
> while an "em-dash" is much more noticeable, this "en-dash" can be confused more easily, especially depending on the font used:
>  {code:java}
> – en-dash                     
> - minus, or hyphen (standard)
> — em-dash (much more noticeable in the difference)
> {code}
> It is suggested for the parser/compile to emit a warning if the en-dash is used in an expression --or potentially if it's the last character in a viable alternative.
> A good way to check for the behavior is to use the wrong expression above to exhibit the behavior when the en-dash is misplaced for a minus sign for a subtraction operation.



--
This message was sent by Atlassian Jira
(v7.13.8#713008)



More information about the jboss-jira mailing list