What about scientific (exponential) notation?

Apr 22, 2011 at 5:04 PM

I get errors when expressions contain literals using exponential notation like "1.5E+09".  Flee says 'E' is an invalid token.  Is there anything I can do to get Flee to successfully parse such literals into doubles?  I can intercept them and apply a "cast" or something before they are passed into flee.

May 5, 2011 at 7:01 PM

It’s easy to fix but it took a while to find right regex which is supported by FLEE. The regex of REAL pattern is not perfect.

  1. Open ..\src\Lib\Parsing\ExpressionTokenizer.vb
  2. Find row 154
  3. Use this regex:  "([0-9]{0}\{1}?[0-9]+|[0-9]+\{1}?[0-9]{0})([eE][+-]?[0-9]+)?"
  4. Compile or run it.
  5. Done

The above regex worked for me but maybe you can create a better one.

Note: The placeholders {0} and {1} are for the digitsBeforePattern („*” or „+”) and options.DecimalSeparator („,” or „.”). They will be replaced in ...src\Lib\Parsing\CustomTokenPatterns.vb by ComputeToken() function.

Good luck!