Skip to content

Add new lexer for DAX#2335

Merged
jeanas merged 10 commits intopygments:masterfrom
GD-L:master
Feb 13, 2023
Merged

Add new lexer for DAX#2335
jeanas merged 10 commits intopygments:masterfrom
GD-L:master

Conversation

@GD-L
Copy link
Copy Markdown
Contributor

@GD-L GD-L commented Feb 2, 2023

Includes new lexer for DAX syntax. Inspired by Highlighter Brush from SQLBI
https://github.com/sql-bi/SyntaxHighlighterBrushDax

Copy link
Copy Markdown
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.

Thank you for working on this.

Here are some comments. Also, please add a test file under tests/examplefiles/dax/ and run pytest --update-goldens tests/examplefiles/dax/ to populate it with the expected tokens, then commit tests/examplefiles/dax.

Comment thread pygments/lexers/_dax_builtins.py Outdated
Comment thread pygments/lexers/_dax_builtins.py Outdated
Comment thread pygments/lexers/dax.py Outdated
Comment thread pygments/lexers/dax.py Outdated
Comment thread pygments/lexers/dax.py Outdated
Comment thread pygments/lexers/dax.py Outdated
Comment thread pygments/lexers/dax.py Outdated
Comment thread pygments/lexers/dax.py
Comment thread pygments/lexers/dax.py Outdated
Comment thread pygments/lexers/dax.py Outdated
@jeanas
Copy link
Copy Markdown
Contributor

jeanas commented Feb 2, 2023

You also need to run make mapfiles and commit the resulting change to pygments/lexers/_mapping.py.

@GD-L
Copy link
Copy Markdown
Contributor Author

GD-L commented Feb 2, 2023

You also need to run make mapfiles and commit the resulting change to pygments/lexers/_mapping.py.

This was included: https://github.com/pygments/pygments/pull/2335/files#diff-1fcf14767c363b55c2b7e1612366433010e2509ea8d34509cfa36125d9989daa

Remove dax builtins, and commit examples & output.
@GD-L GD-L requested a review from jeanas February 3, 2023 15:36
Comment thread pygments/lexers/dax.py Outdated
Comment thread pygments/lexers/dax.py Outdated
@jeanas
Copy link
Copy Markdown
Contributor

jeanas commented Feb 12, 2023

@GD-L One last question, afterwards should be good to go.

@GD-L
Copy link
Copy Markdown
Contributor Author

GD-L commented Feb 13, 2023

@jeanas Thanks for your help, learned a lot doing this!

@jeanas jeanas merged commit 4ae9e07 into pygments:master Feb 13, 2023
@jeanas
Copy link
Copy Markdown
Contributor

jeanas commented Feb 13, 2023

Thanks for your contribution!

@Anteru Anteru added this to the 2.15.0 milestone Mar 25, 2023
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