-
Notifications
You must be signed in to change notification settings - Fork 662
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 support for Wren language #2271
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! Please check the comments to (dramatically) reduce the number of generated tokens, at the moment, you're matching character-by-character in various places which produces enormous amounts of tokens.
See individual comments.
'prefixes' weren't quite right before.
Can you please take a look at the failing test? |
Unfortunately, I don't have a working Windows machine - I only use Linux these days - so I've no idea why the first Windows test is failing. Possibly, it doesn't like the prefixes I've used - Do you have any clue what the problem could be from past experience? Incidentally, on my own machine (Ubuntu 22.04), 'make test' runs fine - 4131 passed, 4 skipped. As regards 'check (pull_request)` failing, this is my first docstring:
Looking at other lexers, I suspect I need to insert a blank line before and after 'Lexer for Wren'. My second docstring looks like this but I can't see anything wrong with it at all:
|
You're correct regarding the module docstring. It also should begin in line 1, not line 2. As for the Windows test, the tests have a random component (testing well-behavedness with a random sequence of input characters), so it should be reproducible regardless of OS with the pytest argument that @Anteru provided. |
OK, thanks. I'll change the module docstring and see if I can get to the bottom of the other problem by running pytest myself with that random seed though I only have Python 3.10.6 installed. |
Corrected module docstring.
I've corrected the module docstring but other issue not yet resolved. |
Hopefully, fixes the problem with the random test.
Hopefully, I've fixed the failing test by adding another regex at the end of 'root' to catch an arbitrary series of characters. I've also taken this opportunity to reclassify 'this' as an ordinary keyword (analogous to 'super') rather than a named built-in as it wasn't really highlighting properly before. |
This was papering over the problem, skipping the positions where it would occur ... The underlying problem was non-terminating behavior with unmatched closing parentheses. Your approach assumed popping when seeing |
Ah, I see now where the problem was. Yes, it looks OK to me and is working fine. Thanks for your help in finally resolving this issue :) |
Happy to help. Merged now. |
This PR adds syntax highlighting support for the Wren programming language.
Wren's github
Wren's website