TheLX5 / AsarSyntaxHighlight-VSCode

Asar syntax highlight for Visual Studio Code
7 stars 4 forks source link

SPC700 & GSU/Super FX mnemonics TextMate grammar implementation #9

Closed TheLX5 closed 3 years ago

TheLX5 commented 4 years ago

Due to similarities in some mnemonics in the three languages asar supports, it makes impossible giving them different scopes with only using TextMate grammars (it'd be completely doable with semantic tokens). TextMate grammars works per line and its multiline support (begin/end, begin/while) gives unwanted highlights to already highlighted text, resulting in even worse regexes for the mnemonics themselves.

A proposed solution is to give EVERY mnemonic the same scope without any sort of diferentiation between 65c816, SPC700 and GSU, this will result in a few changes in the scopes in the 65c816 grammar rules:

keyword.asar.mnemonics.65c816 will disappear, instead we will have keyword.asar.mnemonics contaning every single mnemonic available, including the children scopes in keyword.asar.mnemonics.65c816 such as keyword.asar.mnemonics.stack.

These changes will also affect filenames! 65c816.tmLanguage, spc700.tmLanguage, spc700inline.tmLanguage and superfx.tmLanguage will be merged into mnemonics.tmLanguage and deleted once the merging is done.

Expected changes:

SPC700 specifications

GSU specifications

Possible new scopes

Note: Everything listed here will be under the keyword.asar.mnemonics parent to make this list less clutered

If anyone has questions, comments or suggestions about the changes, ideas, scopes or anything post them here. I'll gladly accept any of that, especially if it's about SPC700 and GSU.

TheLX5 commented 3 years ago

Added in v1.0.0.