Uploaded image for project: 'CloverDX'
  1. CloverDX
  2. CLO-18918

CTL: fix parsing of floating point numbers

    XMLWordPrintable

    Details

      Description

      Unintentionally, CTL currently allows the following format of floating point numbers:

      number n = 10.; // == 10.0f
      

      This causes parsing errors when calling a function using the postfix syntax for the first parameter:

      date d = 10.long2date(); // Syntax error on token 'long2date'
      

      It is caused by the following regular expression in <FLOATING_POINT_LITERAL>:

      < FLOATING_POINT_LITERAL:
            (["0"-"9"])+ "." (["0"-"9"])* (<EXPONENT>)? (["f","F","d","D"])?
            // ...
      >
      

      The numeric part after the decimal dot should be mandatory:

      < FLOATING_POINT_LITERAL:
            (["0"-"9"])+ "." (["0"-"9"])+ (<EXPONENT>)? (["f","F","d","D"])?
            // ...
      >
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              krivanekm Milan Krivanek
              Reporter:
              krivanekm Milan Krivanek
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 30 minutes
                  1h 30m