Skip to content

Comments and Whitespace

Matt Bierner edited this page Jan 31, 2014 · 1 revision

Comments

Khepri uses ECMAScript syntax for single and double line comments.

1 + 2; // single line comment.

/*
 * multiline comment
 */
1 + 2;

1 + /* multiline comment inline */ 2;

Both single and multiline comments are treated as whitespace during lexing.

Whitespace and Semicolon Insertion

Whitespace is not significant during parsing and Khepri does not use ECMAScript's semicolon insertion. Semicolons must always be explicitly used after statements that require them.

// Khepri will ignore whitespace and not insert semicolons
var z =\
  x
  y
->  {
var z
= 10;

/* so you can format your code
 * in interesting ways */
return z
+ x
+ y;
};
Clone this wiki locally