benmarch / spel2js

Parse Spring Expression Language in JavaScript
Other
69 stars 19 forks source link

feat(parser): Add implementations (that simply throw an error) for all "not implemented" tokens #6

Closed christopherthielen closed 5 years ago

christopherthielen commented 5 years ago

Also adds a naive javascript implementation for OperatorMatches.

The intention here is to allow spel2js to parse an expression, even if it cannot evaluate that expression. This moves the error to the evaluation phase.

I'd like to use spel2js to do client-side syntax validation of expressions that are evaluated serverside by Spring. The unimplemented tokens being undefined references is causing parsing itself to fail.

@benmarch PTAL, are you still maintaining this repo?

christopherthielen commented 5 years ago

thanks @benmarch I really appreciate it! I may do some additional work down the road, so I would really appreciate being made a contributor!

We're using this library in Spinnaker and I've found it quite useful! Enjoy your trip.

benmarch commented 5 years ago

Hey @christopherthielen, sorry it took so long but I merged and published a new version (0.2.6). I also added you as a collaborator. Thanks for the contributions!