davedelong / DDMathParser

String → Number
MIT License
854 stars 153 forks source link

Logic expressions. Compare Strings #97

Closed voloshynslavik closed 9 years ago

voloshynslavik commented 9 years ago

Hi @davedelong! Thank you for the useful library. I would like to use it in my project. But for me need feature for compare Strings. For example: " ('B' != 'A') && ('k' != 'K') ". Is the easy way to add this functionality to your library?

davedelong commented 9 years ago

Theoretically this is possible, but it's not currently very easy to do. I'll investigate making this simpler.

davedelong commented 9 years ago

I've added a very rudimentary way of doing this on the 2.0 branch. You'll supply a FunctionOverrider to the Evaluator. It will get invoked every time the evaluator attempts to evaluate a function, and you get the chance to do your own fancy processing.

The 2.0 branch will be merged in to master soon.