#408 Edit modes: Support handling of nested code comments

open
nobody
core (195)
5
6 days ago
2011-10-24
Bosse Iseborn
No

I program a lot in a dialect of Pascal called Pascal/D80, and due to dialectal features and our own coding standards it is very common with nested comments in our source code, sometimes in several levels. I have written a Pascal/D80 language mode for jEdit which works quite well except that it cannot handle nested comments.

Basically, nested comments cannot be handled using only regular expressions. Depending on how jEdit implements edit mode parsing it would either require recursive parsing or a "level counter".

I am thinking about something in the lines of a new attribute:

<SPAN ALLOW_NESTING="TRUE" TYPE="COMMENT1">
<BEGIN>(*</BEGIN>
<END>*)</END>
</SPAN>

Discussion