TomFrost / Jexl

Javascript Expression Language: Powerful context-based expression parser and evaluator
MIT License
573 stars 94 forks source link

Add support for arbitrary whitespace in expressions. #19

Closed Osmose closed 8 years ago

Osmose commented 8 years ago

This replaces the whitespace detection in the lexer to match any whitespace, rather than just spaces, which in turn allows for JEXL expressions with arbitrary whitespace in them, including newlines. I'm not entirely sure I added enough test coverage, but I also didn't want to just enumerate all the existing tests "but with newlines". Feel free to suggest more test cases you'd like to see.

I saw that #3 adds multiline expressions, but bundles it with a bunch of other stuff that I'm not really interested in, and it seems like it'll be awhile before it lands. My hope is that this is a much smaller change that can land sooner, as multiline expressions would really be useful for our project's use of JEXL.

Thanks for writing such a neat library!

TomFrost commented 8 years ago

This is great, thanks!