-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple instances of jsep with different operators #211
Comments
@EricSmekens and @LeaVerou - any thoughts on this? I know when we first started moving into a plugin system, this was discussed, but then dropped to reduce complexity/scope. I feel like this could be useful in some cases and could be re-done similar to what this commit removed? |
Any proposal for additional complexity should be justified through use cases. What are the use cases for having multiple parsers with different configurations and how common are they? |
@LeaVerou I would like to use jsep in a library with a custom binary operator but I cannot because of the singleton nature of it might lead to transient, hard to locate bugs |
I think what @joeflateau said sums it up for me. I was considering using this for an application, where I would want to be able to parse boolean expressions and number expressions separately under different rules. While I could manage with this singleton, it would require swapping out the acceptable operators and things each time I want to parse an expression, which is rather wasteful. |
related to #28 |
Hi guys.
There is any reason to have a singleton parser? There is no chance to have more than one jsep with different configuration running in the same app at client side?
Thank you,
Carlos Marcão
The text was updated successfully, but these errors were encountered: