KeyLighter icon indicating copy to clipboard operation
KeyLighter copied to clipboard

[WIP] Batch highlightining

Open Sobak opened this issue 2 years ago • 0 comments

This is one big of a ~~mess~~ draft. It's based off a https://github.com/kadet1090/KeyLighter/pull/56 and obviously it will have to be rebased but for now I kept the somehow-original commit history to make it easier to understand the ~~pain~~ process I was going through.

Open questions

  1. Do we have any support for tokenizing goto labels? From the quick grep of the codebase, I didn't spot anything like that. I think it could be nice but of course it's outside of the scope for this PR
  2. I have a problem with matching variables. Batch allows two variants of syntax: %foo% and %foo - I have created two regex-based rules to match these. However, no matter how I set their priorities, %foo% always gets matched as "comment %foo" and then "comment %" (even though I use \w+). This can be seen in the token dump of small.bat or with the debug formatter
  3. What is the delimiter rule used in Shell highlighting for?
  4. For whatever reason I can't match just some of the comments in the bit.batch. This one really puzzles me tbh oO it can be seen from the token dump but lemme attach a screenshot to make it even more obvious

image

pls send help

Sobak avatar Feb 11 '24 09:02 Sobak