mparlak / Flee

Fast Lightweight Expression Evaluator
607 stars 119 forks source link

Bug in TokenStringDFA #105

Open anth-git opened 1 year ago

anth-git commented 1 year ago

TokenStringDFA methods use Char.ToLower() instead of Char.ToLowerInvariant(). This is problem for example in Turkish culture, because capital letter I is converted to dotless ı, and an expression cannot be tokenized:

Steps to reproduce

Thread.CurrentThread.CurrentCulture = new CultureInfo("tr-TR");
_expressionContext.CompileGeneric<double>("IF (R < 0.8; 1; 2)");

->

Flee.Parsing.ParseException: unexpected character 'I', on line: 1 column: 1
   at Flee.Parsing.Tokenizer.NextToken() in ...\Flee-master\src\Flee\Parsing\Tokenizer.cs:line 207