13xforever / x86-assembly-textmate-bundle

A bundle for TextMate/Sublime Text providing syntax highlighting for x86 assembly code.
MIT License
82 stars 24 forks source link

Classify PROC & ENDP statements #21

Closed Sainan closed 1 year ago

Sainan commented 1 year ago

Before: image

After: image

I also think the .CODE part could be classified as something, maybe comment.

13xforever commented 1 year ago

sorry for late reply, but I'm quite busy these days

some things to keep in mind:

  1. the tmLanguage grammar is produced from YAML-tmLanguage source
  2. you probably want to use begin/end pattern matching to wrap the function body in meta.function.body, not just the declaration string as it is right now (I'm not sure if old textmate grammar supports matching scopes with back references, but you can probably work around it by including nested matches with #include per top-level patterns in repository, similar to this example); this guide might be helpful
  3. also, you only allow alpha-numerics in the function name where in most cases you want to also allow at least underscores, but probably the same as already existing function name pattern [:alnum:]_$#@~.?
Sainan commented 1 year ago

Since the grammar is YAML based, I guess I shouldn't bother modifiying the tmLanguage?

13xforever commented 1 year ago

yeah, it's part of packagedev for sublime that I used at the time

Sainan commented 1 year ago

Hah, well, if I end up using "Convert PList to YAML" that's a huge diff. I guess I'll just keep my modified tmLanguage to myself.