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 K and Q lexers #2073

Merged
merged 7 commits into from
Mar 5, 2022
Merged

add K and Q lexers #2073

merged 7 commits into from
Mar 5, 2022

Conversation

psaris
Copy link
Contributor

@psaris psaris commented Feb 27, 2022

a jupyter notebook kernel is available for the Q language: https://github.com/KxSystems/jupyterq

syntax highlighting gets lost when using 'jupyter nbconvert' because there is no pygments lexer.

please accept the submission for a new Q lexer which is based on the K lexer (just as the Q programming language was created as a macro layer on the underlying K programming language).

Copy link
Contributor

@jeanas jeanas left a comment

Choose a reason for hiding this comment

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

Thanks, this looks mostly good to me, with some unimportant remarks but a few important ones too.

pygments/lexers/q.py Outdated Show resolved Hide resolved
pygments/lexers/q.py Outdated Show resolved Hide resolved
pygments/lexers/q.py Outdated Show resolved Hide resolved
pygments/lexers/q.py Outdated Show resolved Hide resolved
pygments/lexers/q.py Outdated Show resolved Hide resolved
pygments/lexers/q.py Outdated Show resolved Hide resolved
pygments/lexers/q.py Outdated Show resolved Hide resolved
pygments/lexers/q.py Outdated Show resolved Hide resolved
pygments/lexers/q.py Outdated Show resolved Hide resolved
pygments/lexers/q.py Outdated Show resolved Hide resolved
@psaris
Copy link
Contributor Author

psaris commented Mar 2, 2022

@jean-abou-samra thank you for your constructive comments. i've made the requested updates (and included one formatting question)

@psaris psaris force-pushed the heads/qlexer branch 5 times, most recently from 0608de4 to 0a3f382 Compare March 2, 2022 03:13
@birkenfeld
Copy link
Member

Thanks for the hint about the suboptimal example in the docs! This should be fixed with #2075.

@jeanas
Copy link
Contributor

jeanas commented Mar 2, 2022

One more thing: please add these languages to doc/languages.rst.

@psaris
Copy link
Contributor Author

psaris commented Mar 3, 2022

@jean-abou-samra @birkenfeld have made the requested updates

Copy link
Contributor

@jeanas jeanas left a comment

Choose a reason for hiding this comment

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

One last remark, generally looks good to me.

pygments/lexers/q.py Outdated Show resolved Hide resolved
@psaris
Copy link
Contributor Author

psaris commented Mar 3, 2022

@jean-abou-samra have responded to your suggestion. gave some reasons why i picked Operator.Keyword but am open to your suggestion if it fits more naturally with Pygments.

@psaris
Copy link
Contributor Author

psaris commented Mar 4, 2022

@jean-abou-samra i've updated the K c++ defined keywords as Operator.Word and and Q K-defined keywords as Name.Builtin.

pygments/lexers/q.py Outdated Show resolved Hide resolved
pygments/lexers/q.py Outdated Show resolved Hide resolved
@jeanas jeanas merged commit 20c9141 into pygments:master Mar 5, 2022
@jeanas
Copy link
Contributor

jeanas commented Mar 5, 2022

Thanks for all the updates! Merged now.

@birkenfeld
Copy link
Member

Needs a changelog-update label?

@jeanas
Copy link
Contributor

jeanas commented Mar 5, 2022

I thought this was implied by not setting the milestone? (CC @Anteru)

@birkenfeld
Copy link
Member

You're right, sorry, I misremembered the procedure :)

@psaris
Copy link
Contributor Author

psaris commented May 10, 2022

@birkenfeld @jean-abou-samra, i see that this lexer has been included in the 2.12.0 release. i don't see it in the release notes however: https://github.com/pygments/pygments/releases/tag/2.12.0

@jeanas
Copy link
Contributor

jeanas commented May 10, 2022

Well, so our procedure for CHANGES updates is not working as well as it could :-)

@Anteru Did you just not notice this PR among those without a milestone, or did I do something wrong?

How about simplifying our lives and always setting Changelog-update on PRs that will need a CHANGES update, independently from milestones?

@psaris
Copy link
Contributor Author

psaris commented May 14, 2022

@Anteru in addition the the procedure changes, will/can the release notes be updated?

@jeanas
Copy link
Contributor

jeanas commented May 14, 2022

@psaris I think @Anteru has personal reasons not to be available at the moment, so please give him a little time.

@jeanas
Copy link
Contributor

jeanas commented May 20, 2022

I'm doing the CHANGES update now. For the future I suggest always using the Changelog-update label as "single source of truth".

@jeanas jeanas added this to the 2.12.0 milestone May 20, 2022
@psaris psaris deleted the heads/qlexer branch May 22, 2022 00:47
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.

None yet

3 participants