Open cwfoo opened 6 years ago
Something like the following seems to do it:
syn region racketData start=/(/ end=/)/ contained transparent contains=racketData
syn region racketSExpressionComment matchgroup=racketSExpressionComment start=/#;(/ end=/)/ contains=racketData
syn cluster racketNormal add=racketSExpressionComment
syn cluster racketQuotedOrNormal add=racketSExpressionComment
hi def link racketSExpressionComment Comment
@c42f Your proposed solution does not handle this case:
(/ 6 #;0 2)
The 2)
part will be incorrectly highlighted as a comment.
Refer to SRFI 62: S-expression comments for more examples.
A solution already exists in Vim's Scheme syntax file:
https://github.com/vim/vim/blob/v8.2.2663/runtime/syntax/scheme.vim#L70-L74
Add support for s-expression comments. For example:
Currently, the second line is highlighted as code. It should be highlighted as a comment.