Sublime Forum

Syntax Coloring: custom code block delimiters

#1

Hi, apologies if this has been asked before but I can’t find anything on it. I am making a syntax coloring module for IBM’s REXX language. While most languages (like the C family) will define a code block using curly braces { }, REXX has DO and END delimiters to open and close logical code blocks, which can also be nested.

Can I specify this convention in the YAML syntax file? I like how Sublime will automatically highlight matching pairs of braces, brackets, parentheses, etc., and it’d be nice to see it do this with other types of logical code blocks.

0 Likes

#2

I don’t think it’s possible to control bracket matching other than turning it off or on for the varieties that Sublime natively supports.

The BracketHighlighter package is usually what one would use to get extra highlighting action (I think for this very reason), and I think it supports something like this.

If you’re just asking for yourself, I would try that; if you’re working on a REXX package I think you’d have to do something similar to what BH is doing if you want to provide it (or just recommend BH to the users of your package).

0 Likes

#3

Yeah, I’m just making this file for myself, so BracketHighlighter sounds exactly like what I would need. Thanks man!

0 Likes