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

Allow the '-' in the expression key parser #999

Merged
merged 7 commits into from Aug 4, 2020
Merged

Conversation

tobim
Copy link
Member

@tobim tobim commented Jul 31, 2020

No description provided.

@tobim tobim added the bug Incorrect behavior label Jul 31, 2020
@tobim tobim requested a review from mavam July 31, 2020 14:52
@mavam
Copy link
Member

mavam commented Aug 1, 2020

Should - really be allowed to be at the beginning of a field name? What are the consequences for the language, given that a field can be either on LHS and RHS? What are the implications for allowing arithmetic on operands?

@tobim
Copy link
Member Author

tobim commented Aug 3, 2020

@mavam I changed the code so '-' is not allowed as the first character any longer.

The last commit moves the entire implementation of the parser to the .cpp file. This is done with the intention to reduce coupling and compile times.

libvast/vast/concept/parseable/vast/expression.hpp Outdated Show resolved Hide resolved
auto operand
= parsers::data ->* to_data_operand
= (parsers::data >> !key_char) ->* to_data_operand
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is end-of-input (eoi) also "not a key char"?

That is, does it work when the operand is either LHS or RHS?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eoi is not a char. If data consumed the last character, key_char will fail no matter what it is composed of.

@tobim tobim force-pushed the topic/expression-key-dash branch from 7778e6c to 2becb72 Compare August 4, 2020 12:36
@tobim tobim merged commit 4953037 into master Aug 4, 2020
@tobim tobim deleted the topic/expression-key-dash branch August 4, 2020 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior
Projects
None yet
2 participants