-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: require string tokens used as comparison values to be delimited #23
Conversation
I still need to update the docs and add a CHANGELOG entry. Besides those chores, this PR is ready for review. |
The runes were in reversed order and this fix just relies on casting the slice or runes to a string
df8771a
to
d2d414c
Compare
Do we want this? Would it be better to standardize on a single delimiter so that you can include others without escaping? e.g. if we standardize on single quote, we don't need to escape embedded double quotes. Or if we standardize on double quotes we don't need to escape apostrophes. |
The idea is to make it easier for the user by allowing them to choose the most convenient delimiter for the query they're writing. Examples using double-quotes, single-quotes and backticks:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add some quoted strings to the fuzz tests?
lexStringState(...) is refactored into two distinct state functions: lexStringState(...) and lexSymbolState(...)
9875cd6
to
e7f4757
Compare
Originally, you could could write a query like:
name=alice
This PR requires that same query to be written as:
name="alice"
This change will allow us to introduce new keywords and/or reserved words as needed in the future without introducing breaking changes. It also disambiguates symbols from strings.
Also, this PR sets us up to support additional string delimiters in a subsequent PR. For instance, we can support
`
(backtick) and'
(singe quote) as string delimiters which would really improve the UX for writing queries.This PR also includes: