dynamicexpresso / DynamicExpresso

C# expressions interpreter
http://dynamic-expresso.azurewebsites.net/
MIT License
2.02k stars 379 forks source link

Misleading Parser error on '<' with missing Parameter #314

Closed andreasmo closed 3 months ago

andreasmo commented 3 months ago

When a '<' follows after an unknown identifier a '>' expected Error is generated not Unknown identifier

Reproduce in RoslynPad:

#r "nuget: DynamicExpresso.Core, 2.16.1"

using DynamicExpresso;
var i = new Interpreter();
//var x= i.Eval("a < 1 || b > 1 ", new [] {new Parameter("a", -1.0m)}); // -> Unknown identifier 'b' (at index 9). [as expected]
var x= i.Eval("a < 1 || b < 1 ", new [] {new Parameter("a", -1.0m)}); // -> '>' expected (at index 13). [misleading]