-
Notifications
You must be signed in to change notification settings - Fork 1
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
Improve syntax highlighting #3
Comments
Thanks! I'll try to look into this. Variables preceded by |
OK, I've converted the program using SourceCoder3, and indented it properly (the |
I found the solution to the easy problems. |
I've implemented your changes in c7aca74. I've published the update on the Marketplace and the Releases tab as well. I've been a bit busy this past week but I'll try to look into the other two things. I guess it's time to figure out Regex again 😆 |
It looks like you need
|
As far as I'm aware, how things are highlighted depends on the theme. If a theme doesn't have a color for |
Yes, you're right, that's controlled by the theme. To fix this you can classify them as |
I've looked into the two more difficult issues again and I'm wondering if the best course of action is to just match the token rather than also checking for correct syntax. This is what TI-Planet's Project Builder does, for example. What would you think of that solution? To clarify: Currently stuff is matched with word breaks for more correct syntax, but removing those would properly highlight the token at all times. However, there's less error checking because checking for just |
Sounds good, just make sure to match the tokens in the correct order and use lookbehind and lookahead:
Good luck! Edit: Escaping parenthesis is possible:
|
I've made the changes and pushed them, along with updating the latest release. Let me know if you feel like the issue has been resolved or there's still changes to make :) |
AMAZING work, just some minor polishing...
Note that this is NOT a complete list. |
I've updated the extension and did a little testing of my own and it seems that things are properly detected, at least the way I think they should.
|
I'm afraid we're not done yet. I've spent the entire day creating a file with every token and they aren't properly highlighted: Persisting problems (besides the final boss):
I believe that Source Coder 3 does something wrong with the accented letters, so you don't have to worry about that. It also can't load this file even though TI Connect can. |
Thanks so much for taking the time to create that file! I found it very useful for debugging highlighting. Have a look at d05c76d and let me know what you think. There are a few tokens that were not properly highlighted because they were missing a Let me know what you think and when it's ready I'll publish a new release! |
Looks fairly good, but 3 remarks:
Hmm, are these missing characters getting fixed for Source Coder 3? Because it would be a pain to do manually. |
The changes are made! I'll try to look into getting it corrected in SourceCoder and confirm what's going on before I publish a release. |
Hmm, |
Looks like the issue with SourceCoder has been corrected: http://ceme.tech/p305502 I think I need to change the Goto detection to |
Some more ideas:
|
I feel like this is in a good enough state that I'm going to mark this closed for now (unless there's any significant issues left). I'm also considering changing token syntax slightly in #4. Feel free to make a new issue or submit a PR if there's any major issues you're still encountering, but looking through the tokens file you provided everything looks okay to me. |
I've updated the TOKENS2.8xp.zip. |
The extension doesn't handle my byte optimised program very well:
Easy problems:
DelVar
: is matched with(?<=[^a-z]|Ans)DelVar(?=[^a-zA-Z]|$)
instead of(?<=[^a-z]|Ans|^)DelVar(?=[^a-zA-Z]|$)
keyword.operator.8xp
instead ofkeyword.operator.logical.8xp
(or
,and
,not()
,xor
)Harder problems:
DelVar
: instructions can be appended to a DelVar without using a colonThe text was updated successfully, but these errors were encountered: