Comment (computer programming): Difference between revisions

Content deleted Content added
Examples: Merge D into curly brace languages section
Curly brace languages: Eliminate subsection
Line 357:
</syntaxhighlight>
 
Some languages, including D and Swift, allow blocks to be nested while other do not, including C and C++. An example of nested blocks in Swift:
 
An example of nested blocks in D:
<syntaxhighlight lang="swift">
/* This is the start of the outer comment.
/* This is the nested comment. */
This is the end of the outer comment. */
</syntaxhighlight>
 
====Nested block in D====
D uses C++-style comments with additional syntax for nestable blocks delimited by <code>/+</code> and <code>+/</code>.
 
<syntaxhighlight lang="d">
Line 376 ⟶ 369:
/+ inner block +/
end of outer block +/
</syntaxhighlight>
 
An example of nested blocks in Swift:
 
<syntaxhighlight lang="swift">
/* This is the start of the outer comment.
/* This is the nested comment. */
This is the end of the outer comment. */
</syntaxhighlight>