In most the languages I use, you simply cannot nest block comments, because the first occurrence of the "close" comment syntax closes the comment even if it was only an "inner" comment.
For example, in HTML
<!-- outer comment
<p>hello</p><!-- inner comment <p>world</p> -->
<p>this should BE commented</p>
-->
in this case, the outer comment ends on the first --> instead of the corresponding last one, causing the last <p> to print, when it shouldn't.
The same happens for languages that use /* */ for block comments, like in java, php, css, javascript, etc.
But my question is WHY is it that way? Why, by design, it is not allowed? I mention "by design" because I really doubt it is because of parsing problems, I guess the parsers are perfectly capable of keeping track of opening /*s and close the comments with their corresponding closing */s But they simply somehow decided it is not a good idea.
I already know that a workaround for this is to somehow change the inner closing comments, to avoid them to close , and only leave the last closing one. e.g. changing inner -->s and */s for - ->s and * /s . But that is obviously not convenient, and hard to do when you only want to discard blocks of code for debugging purposes. (other techniques are to nest everything in if(false){} blocks, but that is not the point here.
So, what I'd like to know is WHY nested comments are generally not allowed in several modern languages? there must be a good reason other than "others don't do it, we won't either" right?.
And as a plus, are there any other (not so obscure) languages that DO allow nested block comments?
/* */instead of other workarounds.