Conversation
jeanas
left a comment
There was a problem hiding this comment.
A few comments; please also inline the 'keyword' and 'whitespace' states, which don't need to be separate.
| (words(( | ||
| 'del', 'jump', 'call', 'branch', | ||
| ), suffix=' '), Keyword), |
There was a problem hiding this comment.
| (words(( | |
| 'del', 'jump', 'call', 'branch', | |
| ), suffix=' '), Keyword), | |
| (words(('del', 'jump', 'call', 'branch'), prefix=r'(', suffix=r')( )'), bygroups(Keyword, Whitespace)), |
| 'whitespace': [ | ||
| (r'(\n|\s)', Text), | ||
| ], |
There was a problem hiding this comment.
| 'whitespace': [ | |
| (r'(\n|\s)', Text), | |
| ], | |
| 'whitespace': [ | |
| (r'\s+', Whitespace), | |
| ], |
Avoid “1 token per char”. See https://pygments.org/docs/lexerdevelopment/#common-pitfalls-and-best-practices
|
(I am working with @Matt711) @jeanas Many thanks for reviewing this - this PR was opened prior to us receiving approval to contribute it upstream to Pygments due to a miscommunication. Thank you for providing the suggestions above - we'll hold off updating the PR until we've received approval to make this contribution, then address the feedback above (I hope this won't delay things too long). Apologies for the slight confusion here. |
pygments/lexers/numbair.py
Outdated
| @@ -1,3 +1,4 @@ | |||
| # Copyright (c) 2023, NVIDIA CORPORATION. | |||
There was a problem hiding this comment.
What is the purpose of this line?
There is already “Copyright 2006-2023 by the Pygments team, see AUTHORS”; you should add yourself or NVIDIA (not sure which is correct legally) there if you want to record the copyright.
|
We received permission / approval to make this contribution upstream, so we can now continue to work on this PR - many thanks for your time and understanding so far @jeanas, and apologies for the delay. |
|
Merged, thanks! |
Add a Lexer for Numba Intermediate Representation (IR).