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

add more consistency in ast #523

Merged
merged 2 commits into from Jun 14, 2022

Conversation

frolovdev
Copy link
Contributor

Closes #472

@coveralls
Copy link

coveralls commented Jun 13, 2022

Pull Request Test Coverage Report for Build 2491105118

  • 16 of 21 (76.19%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.03%) to 89.813%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/ast/mod.rs 2 4 50.0%
src/parser.rs 14 17 82.35%
Totals Coverage Status
Change from base Build 2488373371: -0.03%
Covered Lines: 8764
Relevant Lines: 9758

💛 - Coveralls

Copy link
Collaborator

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thanks @frolovdev -- looks like a nice cleanup.

cc @andygrove

src/parser.rs Outdated
match self.peek_token() {
Token::Word(w) => match w.keyword {
Keyword::EXISTS => {
let negated = self.parse_keyword(Keyword::EXISTS);
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't we know here that negated is true? I think the code might be clearer if this were something more like

let negated = true;
self.parse_keyword(Keyword::Exists);
self.parse_exists_expr(negated)

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I will make an update in a minute

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made an update but use placeholder (let _) because of clippy checks

@frolovdev frolovdev requested a review from alamb June 13, 2022 20:51
@alamb
Copy link
Collaborator

alamb commented Jun 14, 2022

Looks good -- thanks @frolovdev

@alamb alamb merged commit c884fbc into sqlparser-rs:main Jun 14, 2022
mobuchowski pushed a commit to mobuchowski/sqlparser-rs that referenced this pull request Aug 3, 2022
* add more consistency in ast

* refactor styling
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

Successfully merging this pull request may close these issues.

Make NOT EXISTS (subquery) and NOT IN (subquery) more consistent in the AST
3 participants