Why nested comments are not allowed




















Site Search User. Mentions Tags More Cancel. Ask a related question What is a related question? A related question is a question created from another question. When the related question is created, it will be automatically linked to the original question.

In compilers for languages that do not allow nested comments the parser never see the comment at all. The comments are eaten by the scanner which is a much simpler part of the compiler than is a parser. Essentially, any language that requires balancing characters e. Quote: Todd M. This apprears to be a religious issue. It is not the least bit "obvious" to me that "nested comments are the better way" to suppress the compilation of a section of code.

What is this, if not conditional compilation? Why nested comments not allowed? Mike McNelly. Todd M. Nested comments are the. John H. Louis, MO Page 1 of 3. Go to page: [1] [2] [3]. Yet Another Argument for Nested Comments 7. If this happens with standard code not with Microsoft syntax which violates the standard and does not happen with the Microsoft compiler, your complaint would look more compelling.

Quoting TimP Intel. If this happens with standard code not with Microsoft syntax which violates the standard and does not happen with the Microsoft compiler , your complaint would look more compelling. Hello Sergey, I tried to reproduce this problem and I'm not seeing this remark - even with warning level of 5. ILevi1 Valued Contributor I. Learn more. How to solve the problem of nested comments Ask Question.

Asked 8 years, 5 months ago. Active 1 year, 11 months ago. Viewed 21k times. Improve this question. Niklas Rosencrantz. Niklas Rosencrantz Niklas Rosencrantz 7, 16 16 gold badges 54 54 silver badges 92 92 bronze badges. I think only editors can help you there. Python does not have block comments. The ''' and """ are string literals.

Docstrings, i. So this is not really an issue. Using comments to do this is the wrong tool. I switched to using only line comments long ago as long as I'm not forced, e. Of course, you need editor support or at least column mode. Add a comment. Active Oldest Votes.



0コメント

  • 1000 / 1000