Skip to main content

Comments

Wave supports two types of comments.

  • Single-line comment: //
  • Block comment: /* ... */

Single-line comment

The content following // is ignored until the end of the line.

var x: i32 = 10; // line comment
x += 5; // still works

Block comment

The content between /* and */ is ignored.

var y: i32 = 1 /* inline block */ + 2;

Block comments support multiple lines and nesting.

/* outer
/* inner */
outer end
*/

Strings and Comment Symbols

/*, */, and // within strings are not treated as comment delimiters.

var marker: str = "/*//*/";

Comment Error

If a block comment is not closed, a compile error (E1002) occurs.

/* not closed

The compiler outputs the start location, cause, and fix hints.