Skip to content
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

unable to compare string to any operator symbol (as string) #22

Closed
mirdhyn opened this issue Aug 3, 2016 · 2 comments
Closed

unable to compare string to any operator symbol (as string) #22

mirdhyn opened this issue Aug 3, 2016 · 2 comments
Assignees
Labels

Comments

@mirdhyn
Copy link

mirdhyn commented Aug 3, 2016

For example, following code fail with runtime error: index out of range :

expression, err := govaluate.NewEvaluableExpression("'foo' == '-'")
result, err := expression.Evaluate(nil)

Same thing with any of the operator symbols (-, +, /, * and %)

@Knetic
Copy link
Owner

Knetic commented Aug 3, 2016

Sorry for the bug!

Looks like I missed some TokenKind checks when the expression gets parsed out into stages, and didn't have any test cases which would catch it. f0224e3 should fix any of these panic cases where strings are misinterpreted.

@Knetic Knetic self-assigned this Aug 3, 2016
@Knetic Knetic added the bug label Aug 3, 2016
@mirdhyn
Copy link
Author

mirdhyn commented Aug 3, 2016

Your commit successfully fixed the issue.
Thank you very much, that was a very fast reaction!

@mirdhyn mirdhyn closed this as completed Aug 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants