Skip to content

Improve comments on Dialect #1366

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

Merged
merged 1 commit into from
Aug 6, 2024
Merged

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Aug 6, 2024

While reviewing @samuelcolvin 's PR on #1360 I noticed several areas of the Dialect documentation that could be improved.

This PR updates the documentation for DIalect

@@ -114,16 +115,20 @@ pub trait Dialect: Debug + Any {
fn is_delimited_identifier_start(&self, ch: char) -> bool {
ch == '"' || ch == '`'
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the use of whitespace between functions was inconsistent -- sometimes there was a space and sometimes not. Thus I made it all consistent with my personal preference (put a space between functions0

Copy link
Contributor

Choose a reason for hiding this comment

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

👍 I really wish rustfmt would fix this to be consistent.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 10266109448

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 89.039%

Totals Coverage Status
Change from base Build 10265936092: 0.0%
Covered Lines: 27619
Relevant Lines: 31019

💛 - Coveralls

@alamb
Copy link
Contributor Author

alamb commented Aug 6, 2024

Thank you for the review @lovasoa

@alamb alamb merged commit da484c5 into apache:main Aug 6, 2024
10 checks passed
@@ -114,16 +115,20 @@ pub trait Dialect: Debug + Any {
fn is_delimited_identifier_start(&self, ch: char) -> bool {
ch == '"' || ch == '`'
}

Copy link
Contributor

Choose a reason for hiding this comment

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

👍 I really wish rustfmt would fix this to be consistent.

/// Get the precedence of the next token. This "full" method means all precedence logic and remain
/// in the dialect. while still allowing overriding the `get_next_precedence` method with the option to
/// fallback to the default behavior.
/// Get the precedence of the next token, looking at the full token stream.
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for fixing this, sorry my comment was so broken.

I'm not sure "full token stream" is really the right distinction, my name was probably poor.

If we didn't might breaking the API, we could probably call the above get_next_precedence_opt - the only real difference is that it returns an Option so can fallback to the default behaviour.

Or we could call this method get_next_precedence_default.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We haven't yet released this PR so we can change the name without any API breakages yet

Any chance you can make a PR with a proposed name change?

Copy link
Contributor Author

@alamb alamb Aug 14, 2024

Choose a reason for hiding this comment

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

@samuelcolvin made a PR here: #1378 ❤️

@alamb alamb deleted the alamb/dialect_comments branch August 7, 2024 18:18
ayman-sigma pushed a commit to sigmacomputing/sqlparser-rs that referenced this pull request Nov 19, 2024
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.

4 participants