-
Notifications
You must be signed in to change notification settings - Fork 692
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 X++ support #2339
Add X++ support #2339
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution. Can you please add an example file as well and generate "golden" test output for it? Reviewing regexes without seeing them run is hard :)
@Anteru, thanks for the feedback I have included a test and its output |
@Anteru , I tried to run mapping for my change because the build failed with this error Not sure how it was different than my manual change but I committed it. |
`git diff` should show that.
|
This fails CI, apparently a missing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks quite well thought out to me, with two reservations:
-
I'm not sure the Unicode level configurability is worth the code, see comment inline.
-
While testing on large files (basically with
for i in {1..1000}; do echo tests/examplefiles/xpp/test.xpp >> bigtest.xpp; done
), I experiencedRecursionError
s. This is because the lexer sometimes recurses withusing(this)
for way too much code. For example, inr'(\s*)\b(else|if)\b(.*)'
, the.*
part will match everything after theif
in the file (since you haveDOTALL
). Please fix this and check that it works on a large file.
@jeanas , thanks for the suggestions. I have tested with a large file and am not experiencing a recursion error. |
Co-authored-by: Jean Abou-Samra <jean@abou-samra.fr>
…pygments into add-xpp-support
Any suggestions to resolve the REGEXLint issue? I use the full set and it complains about null characters not being supported. This is the same regex used in the CSharpLexer, but I think it does not complain about it cause the basic level is default. If I set mine to the basic level, the regex errors go away. |
I've submitted a fix to |
Ah, I just noticed that CI uses the fork https://github.com/pygments/regexlint, not the original https://github.com/thatch/regexlint. @birkenfeld What is the history behind this? |
Probably just switched to a repo I had access to while I was working on the updates for thatch/regexlint#40 - after that was merged I should have switched back to upstream. |
In the meantime, I've added a workaround so we can merge this. It only affects code with null characters, which is quite unimportant to get right. |
NUL chars can be escaped on the regex level with |
Ah, right, I forgot about this. Well, eventually, we'll use |
X++ is a language developed and maintained by Microsoft. It compiles down to CIL. It is considered a .NET language. This is used exclusively within Microsoft's ERP product called Dynamics 365 and its partner ecosystem.
Reference links: