Skip to content

Comments support? #133

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

Closed
Qtax opened this issue Aug 28, 2023 · 8 comments · Fixed by #146
Closed

Comments support? #133

Qtax opened this issue Aug 28, 2023 · 8 comments · Fixed by #146

Comments

@Qtax
Copy link
Contributor

Qtax commented Aug 28, 2023

Seems that there is no support for SQL comments, either single line -- comment nor multi-line /* comments */.

Is this something you would accept a PR for?

If so I'd might also improve the tokenization a bit. If you use a single regex you can get rid one of the nested loops and improve performance.

@scriptcoded
Copy link
Owner

Hey! That's correct, there is no support for comments as of now. If you have a nice solution for adding support for it then please, go ahead! MySQL also supports # comments, so I think there would have to be support for that as well.

I'm on vacation and don't have time to look into how the changes to tokenization might affect the code right now, but please feel free to open a PR for that as well and I'll have a look when I get the time.

And of course, please read the contribution guidelines before you start committing.

Thanks! 😄

@parallels999
Copy link

If so I'd might also improve the tokenization a bit. If you use a single regex you can get rid one of the nested loops and improve performance.

It sounds great

erikn69 added a commit to erikn69/sql-highlight that referenced this issue Sep 11, 2023
erikn69 added a commit to erikn69/sql-highlight that referenced this issue Sep 11, 2023
erikn69 added a commit to erikn69/sql-highlight that referenced this issue Sep 11, 2023
Qtax added a commit to Qtax/sql-highlight that referenced this issue Sep 11, 2023
Faster and simpler tokenization.

Add SQL comments support.

Refs: scriptcoded#133
@erikn69
Copy link
Contributor

erikn69 commented Sep 11, 2023

Hi @Qtax , test #139

@Qtax
Copy link
Contributor Author

Qtax commented Sep 11, 2023

@erikn69 hah, I guess we both made a PR for this 😂

I don't think that # is a comment in SQL.

Also I've improved the tokenizer a bit in my PR if you want to have a look.
No nested loops, processes the SQL string just once.

erikn69 added a commit to erikn69/sql-highlight that referenced this issue Sep 11, 2023
erikn69 added a commit to erikn69/sql-highlight that referenced this issue Sep 11, 2023
@erikn69
Copy link
Contributor

erikn69 commented Sep 11, 2023

MySQL also supports # comments, so I think there would have to be support for that as well.

erikn69 added a commit to erikn69/sql-highlight that referenced this issue Sep 11, 2023
Qtax added a commit to Qtax/sql-highlight that referenced this issue Sep 12, 2023
Add SQL comments support, including MySQL # comments.

Faster and simpler tokenization.

Refs: scriptcoded#133
Qtax added a commit to Qtax/sql-highlight that referenced this issue Sep 12, 2023
Add SQL comments support, including MySQL # comments.

Faster and simpler tokenization.

Refs: scriptcoded#133
@Qtax
Copy link
Contributor Author

Qtax commented Sep 12, 2023

@erikn69 ah, missed that. Added support for # in my PR.

Qtax added a commit to Qtax/sql-highlight that referenced this issue Sep 12, 2023
Add SQL comments support, including MySQL # comments.

Faster and simpler tokenization.

Refs: scriptcoded#133
Qtax added a commit to Qtax/sql-highlight that referenced this issue Sep 12, 2023
Add SQL comments support, including MySQL # comments.

Faster and simpler tokenization.

Refs: scriptcoded#133
Qtax added a commit to Qtax/sql-highlight that referenced this issue Sep 12, 2023
Add SQL comments support, including MySQL # comments.

Faster and simpler tokenization.

Refs: scriptcoded#133
@scriptsbot
Copy link
Collaborator

This issue has been marked as stale because it has been open for 14 days with no activity. Remove the stale label or comment or this will be closed in 5 days.

@scriptcoded scriptcoded removed the Stale label Sep 27, 2023
Qtax added a commit to Qtax/sql-highlight that referenced this issue Sep 28, 2023
Faster and simpler tokenization.

Refs: scriptcoded#133
Qtax added a commit to Qtax/sql-highlight that referenced this issue Sep 28, 2023
Add SQL comments support, including MySQL # comments.

Refs: scriptcoded#133
wkeese pushed a commit to wkeese/sql-highlight that referenced this issue Oct 3, 2023
Faster and simpler tokenization.

Refs: scriptcoded#133
wkeese pushed a commit to wkeese/sql-highlight that referenced this issue Oct 3, 2023
Add SQL comments support, including MySQL # comments.

Refs: scriptcoded#133
wkeese pushed a commit to wkeese/sql-highlight that referenced this issue Oct 3, 2023
Faster and simpler tokenization.

Refs: scriptcoded#133
wkeese pushed a commit to wkeese/sql-highlight that referenced this issue Oct 3, 2023
Add SQL comments support, including MySQL # comments.

Refs: scriptcoded#133
Qtax added a commit to Qtax/sql-highlight that referenced this issue Oct 4, 2023
Faster and simpler tokenization.

Refs: scriptcoded#133
Qtax added a commit to Qtax/sql-highlight that referenced this issue Oct 4, 2023
Add SQL comments support, including MySQL # comments.

Refs: scriptcoded#133
scriptcoded pushed a commit that referenced this issue Oct 4, 2023
Faster and simpler tokenization.

Refs: #133
scriptcoded pushed a commit that referenced this issue Oct 4, 2023
Add SQL comments support, including MySQL # comments.

Refs: #133
@scriptcoded
Copy link
Owner

Closed in #141

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