Dodo doc > Syntax > Comments


Comments

Single line comments start with a hash sign "#" and end with the end of line.

Comment blocks are enclosed between "#---" and "+++". They can span multiple lines and be nested. A comment should not be closed with "+++" on the same line as an unbalanced double quote (") otherwise its end will not be detected.

Documentation for symbols of the program is based on the AsciiDoc format inside quotes. It is introduced with "__DOC".

Examples:

# this comment continues until the end of this line.

#---
This is a comment block.
Another comment block #---is nested here+++.
This shows an ignored "+++
+++

__DOC
"A _house_ object in a drawing"
Rationale: the hash sign is often used for single line comments in scripting languages. It does not denote a common mathematical operation. Because comment blocks are nested and "+++" does not occur in the grammar, the compiler can flag comment blocks opened by mistake. This requires skipping string literals though, which is why a comment cannot be closed after an opening ". Formatted code documentation inside comments in the source file helps maintaining up-to-date documentation and simplifies the generation of stand-alone code documentation.

^ 2. Syntax

v 2.2. Blocks