3 ms·
How about explicit depth levels, specified by asterisk count? e.g. '/*' and '*/' would match each other, '/**' and '**/' would match, and so on. That way, you
by arcanemachiner 3y ago
How about explicit depth levels, specified by asterisk count?
e.g. '/*' and '*/' would match each other, '/**' and '**/' would match, and so on.
That way, you would have full control of the depth of the comments, removing other comments wouldn't break the inner comments, etc.
I do run into the same issue you're describing, so I think there's value in the idea.
- deleted 3y ago[deleted]
- LoganDark 3y agoLike Lua, where comments can be delimited by `--[==[`..`]==]`, where the number of equals signs can be anything but has to match in order for the comment to actually close?
- Wowfunhappy 3y agoThe core idea here is that when I'm commenting out a block of code for testing, I don't really want to think about what is inside of it. So while I think this might help, I'd rather just have /* with one asterisk nest. What I'm not sure of is whether there's an edge case I haven't thought of which would make this problematic.