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

Question about supporting escape in string parsing rule #176

Open
0ctopus13prime opened this issue Apr 13, 2018 · 0 comments
Open

Question about supporting escape in string parsing rule #176

0ctopus13prime opened this issue Apr 13, 2018 · 0 comments

Comments

@0ctopus13prime
Copy link

0ctopus13prime commented Apr 13, 2018

Hi! expert!

I currently using plywood library to mediate query to druid broker.
Yesterday I met expression parse error, so I digged deeper inside plywood and I found below.

String "String"
= "'" chars:NotSQuote "'" _ { return chars; }
/ "'" chars:NotSQuote { error("Unmatched single quote"); }
/ '"' chars:NotDQuote '"' _ { return chars; }
/ '"' chars:NotDQuote { error("Unmatched double quote"); }

In my case construct plywood string expression using query from client like below.

const expressionStr = `$dim.in(['${val1}', '${val2}'])`

and one of the parameters was 'banana",
plywood expression would be $dim.in([''banana"']) or $dim.in(["'banana""]).
Unfortunately, neither of these was accepted.

By parsing rule, single quote string's last character must match. Either 'some' or "some".
For now I avoided this by directly using plywood.LiteralExpression, so no more exceptions thrown.

So, I wonder any plans to support escape rule.

Thanks
Best regard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant