Case Sensitive

Jul 30, 2009 at 4:56 PM

The math functions were case sensitive.  I allow the users to change the formulas to do some of the calculations and instead of "Floor", they had keyed "floor".  I kept getting function not found.

In my copy of the source, I added a ".ToLower" on the switch statement in the EvaluationVisitor.Visit() function (and changed all the case statements to lower case).

I'm not sure if there was a better way around this, but it worked for me.  I didn't know if you could explain a better way to do this or if you wanted to modify the source on your end as well.

Jul 30, 2009 at 5:13 PM
The functions are case sensitive by design. This is an intended behavior, and the solution you use is correct. Another extension to what you did could be to define a static boolean property to define the behavior, or a constructor parameter to Expression(). Or both ;)
Aug 4, 2009 at 1:21 AM

But wouldn't it better that this switch would be done at this side, rather than making craig to hack the original source. Otherwise, he would have to maintain his patch each time new version is released.

This is how all the other parsers work, take for example C# regex parser. 


Also could you please, look at the previous question as well.



Aug 4, 2009 at 8:05 AM

As you suggest I can handle this in the trunk. Thus it makes me think about something else: feedbakc. I will create a discussion on functionnalities and concerns users would like to see addressed.

Aug 5, 2009 at 8:40 AM

That would be great indeed.