Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@anayrat
Copy link
Contributor

@anayrat anayrat commented Mar 31, 2023

Hello,

I suggest this lexer to handle PostgreSQL execution plan obtained thanks to EXPLAIN command (https://www.postgresql.org/docs/current/sql-explain.html).

This work was inspired by Maxence Ahlouche work (https://github.com/maahl/pg_explain_lexer).

I tried to do my best to test and handle most of the cases. I added a keyword [...] which can be useful to truncate very long lines.

Thanks

anayrat added 2 commits March 31, 2023 12:10
This lexer add support for PostgreSQL Explain plan :

https://www.postgresql.org/docs/current/sql-explain.html

This was heavily inspired by Maxence Ahlouche work, thanks to him :
https://github.com/maahl/pg_explain_lexer
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.

LGTM with nits. Can you please add some tests too?

@anayrat
Copy link
Contributor Author

anayrat commented Apr 2, 2023

LGTM with nits. Can you please add some tests too?

Thanks for your review! I will try to add some tests, but it will be hard to cover all the rules :/

@jeanas
Copy link
Contributor

jeanas commented Apr 4, 2023

Now looks good (I added a commit to fix minor issues), only awaiting some tests. (See https://pygments.org/docs/contributing/#how-lexers-are-tested for how to add them.)

@anayrat
Copy link
Contributor Author

anayrat commented Apr 4, 2023

Thanks! I added some tests. Unfortunately, it is hard to cover all keywords :(

@jeanas
Copy link
Contributor

jeanas commented Apr 4, 2023

No need to cover all elements of a words(...) list. It's best if you can cover as many different rules of the lexer, though.

@jeanas jeanas merged commit ef0abba into pygments:master Apr 4, 2023
@jeanas
Copy link
Contributor

jeanas commented Apr 4, 2023

Thanks!

@anayrat anayrat deleted the explain branch April 4, 2023 11:27
@Anteru Anteru added this to the 2.15.0 milestone Apr 10, 2023
@Anteru Anteru added the A-lexing area: changes to individual lexers label Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-lexing area: changes to individual lexers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants