Skip to main content

Source text

Comments and whitespace​

  • // starts a comment that runs to the end of the line.
  • /* ... */ is a block comment that can span lines. Block comments don't nest. An unclosed /* swallows the rest of the script, and you get a compile error at the end.
  • Spaces, tabs and line breaks separate tokens and are otherwise ignored. A statement can span as many lines as you like.
  • Comment markers inside a string literal are just text.

Statements and semicolons​

An assignment or an expression statement ends with ;. A block { ... }, if or for doesn't need one after its closing brace. A stray ; is an empty statement and is harmless, so ;; is fine.

Identifiers​

A variable or builtin name starts with a letter or _, followed by letters, digits or _ (ASCII only). Names are case-sensitive: count and Count are different variables, and windowmaximize(w) is an unknown function.

Keywords​

Five words are reserved: if, else, for, true and false. Nothing else is a keyword. while, return, break, function and so on are ordinary identifiers, so while (x) { } is read as a call to an unknown function named while.

Dotted names​

Namespace.Name with no spaces around the dot refers to a named constant, such as VirtualKey.Enter or FileNotify.LastWrite. It is not member access. There are no objects, and a dot anywhere else is an error.