fix(clojure) comment macro should not be comment scope#3395
fix(clojure) comment macro should not be comment scope#3395joshgoebel merged 2 commits intohighlightjs:mainfrom
comment scope#3395Conversation
|
|
@joshgoebel I may submit more PRs for the Clojure syntax as there are still things that are highlighted not quite right. For Reference:
|
|
@joshgoebel BTW, is there a way to overrule scopes? Yesterday I experimented with highlighting everything as comment, when using (comment
(+ 1 2 3))Would result in: <span class="hljs-comment">
(comment
(<span class="hljs-name">+</span> <span class="hljs-number">1</span> <span class="hljs-number">2</span> <span class="hljs-number">3</span>))
</span>The only way I saw to overcome this is having a clone of all modes without the scopes for exclusive use in the comment mode. |
Not exactly. If your trying to not highlight them then you ONLY need modes to match things that could interfere with bracket counting... you don't need ALL the modes... so in many languages this would mean you'd need to match strings (unscoped) to avoid things like |
I'd also be willing to try this if it was reliable and you wanted to finish it up. One could handle |
|
In my opinion, I can open an issue with other things I noticed off with Clojure highlighting. You are right regarding
Regarding #_1
#_ 1 ; spaces between
#_ ,,,,,,,,,, ; commas are pruely decorative and treated as whitespace
1] |
Ok, we can try that for now. That would put this PR back on track. :)
Yes I realized, but those other cases may be difficult (or impossible) to deal with properly as it is not our goal to parse languages (at other than a surface level)... trying to do so very quickly leads to grammars that are difficult or impossible to maintain. |
comment macro matching more then it shouldcomment scope



Changes
Clojure has a macro

comment, which evaluates to nothing. It is not a special language feature.The current grammar highlights every list beginning with "comment" (See screenshot)
I guess the intention behind that mode was at some point that some editor themes highlight the whole blocks (not just the name) like comments.
Checklist
CHANGES.md