Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-4812

DMN FEEL warn if en-dash is present as a character in expression

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • Major
    • None
    • None
    • dmn engine
    • None
    • 3
    • NEW
    • NEW

    Description

      This is taken from the DMN spec :

      (amount *rate/12) / (1 – (1 + rate/12)**-term)
      

      however this would fail to parse correctly as the first subtraction sign is an "en-dash" (0x2013) and not a minus/hyphen sign (0x2D)

      (amount *rate/12) / (1 – (1 + rate/12)**-term)
                             ^ 
      (amount *rate/12) / (1 - (1 + rate/12)**-term)
      

      while an "em-dash" is much more noticeable, this "en-dash" can be confused more easily, especially depending on the font used:

      – en-dash                     
      - minus, or hyphen (standard)
      — em-dash (much more noticeable in the difference)
      

      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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mmortari@redhat.com Matteo Mortari
              Tibor Zimányi Tibor Zimányi
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: