-
Notifications
You must be signed in to change notification settings - Fork 590
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
refactor(parser): eliminate the gap between parser v1 and v2 #17019
Conversation
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
574da01
to
5c9c66e
Compare
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: TennyZhuang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: TennyZhuang <[email protected]>
@@ -499,12 +471,10 @@ impl Parser { | |||
/// Tries to parses a wildcard expression without any parentheses. | |||
/// | |||
/// If wildcard is not found, go back to `index` and parse an expression. |
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.
Should also update the comments? Also apply to others.
alt(( | ||
preceded( | ||
(Keyword::SYSTEM_TIME, Keyword::AS, Keyword::OF), | ||
alt(( |
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.
Should we cut error here?
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.
I think so. We also need more tests to cover these cases.
Parser::parse_object_name | ||
.parse(parser) |
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.
This does not look that intuitive. 🤣 I guess that's because...
- we make combinator a method instead of a bare function
- the name starts with
parse_
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.
Yes. Eventually we should make these methods bare functions without the parse_
prefix.
Signed-off-by: Runji Wang [email protected]I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
This PR merges
TokenStreamWrapper
withParser
and makes all parser methods returnPResult
, so that they can be used with the combinators inwinnow
.To improve the accuracy of cursor in error context, this PR also:
With this PR, we can migrate the parser from v1 to v2 more smoothly.
Checklist
./risedev check
(or alias,./risedev c
)Documentation