Comments
Zolo has three comment forms: // runs to the end of the line; /* … */
comments a block (no nesting); /// is a documentation comment, surfaced by
the LSP and zolo doc:
A line comment, a block comment, and a /// documentation comment.
01-comments.zolo
// Feature: Comments
// Syntax: `//` (line), `/* ... */` (block), `///` (doc)
// When to use: inline documentation, suppressing code, LSP doc.
// Line comment — runs to end of line.
let x = 42 // inline also works
/*
Block comment. Can span multiple lines.
Does not nest (an inner `/*` closes the outer block
at the first `*/`).
*/
/// Doc comment — shows up on LSP hover and in
/// `zolo doc`. Use on fns, structs, enums, traits.
fn double(n: int) -> int {
return n * 2
}
print(double(x))
// expected: 84
See also