highlight.js
highlight.js copied to clipboard
Overhaul GML highlighting
Changes
I've created a proper grammar for GameMaker Language, which supports many of the language's newer features, and goes a lot further than the existing one - which currently just matches a master list of keywords and function names that must be kept up to date.
The work I've done here is a port of my previous PRs to the GameMaker Manual (https://github.com/YoYoGames/GameMaker-Manual/pull/160, https://github.com/YoYoGames/GameMaker-Manual/pull/220), though since they use a bit of a customised fork, required some extra work to then bring upstream. As this PR encompasses the changes I listed in those PRs above I've avoided re-stating the same changes, though if it would be preferable I can bring them over into this PR's description.
Additional to the PRs however, I've also made some further minor fixes and improvements:
- JSDoc is now highlighted, in all forms stated in the GameMaker Manual.
- Multi-line
#macros are now parsed properly, though this isn't currently a noticeable change. - Many obsolete or incorrect keyword entries have been removed, and some new ones have been added.
- The
gml.csstheme has been updated accordingly with the changes with scopes to more correctly follow the GM IDE's colour scheme.
Comparison
As a visual overview of the changes, here's a before and after!
Before
After
Checklist
- [x] Updated markup tests.
- [x] Updated the changelog at
CHANGES.md
This is a huge change and will need a bit of going thru. I'll drop comments.
Thanks for the thorough review! I've addressed everything I could, though there's two left unresolved with comments as I was unsure how to proceed with them so leaving for further feedback.
Hey, just checking in on the status of this PR - is there anything else I need to do to get it merged? I've not modified CHANGES.md as I wasn't sure when it'd be merged and that seemed like a source of issues to edit that file too soon.
This would be incredible if this could get merged!
Thanks for the persistence in helping me clean this up, should hopefully be up to snuff at this point!
I've just gone ahead and finally updated the changelog, though I noted that the next version is a patch release, so let me know if I should revert that commit until later.
@joshgoebel is there anything else needing to be resolved to merge this?
Is there any reason this is awaiting confirmation? If it's for peer review from someone more experienced in GML this seems about as accurate as we can get. Any pending changes from here would be preference of the repo maintainers them selves.
@joshgoebel apologies for the double-ping now, but I'm still unsure whether you need me to do anything else to merge this. If you've not had the time to look at it, no stress.