Dodo doc > Syntax > Comments


Single line comments start with a hash sign and end with the end of line. Comment blocks are enclosed with "{- -}". 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 comments.


# this comment continues until the end of this line.
{- This is a comment bloc.
Another comment block {- is nested here -}.
This shows an ignored "-}

Rationale:the hash sign is often used for single line comments in scripts and 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