Skip to content

Keywords

aMarCruz edited this page Dec 28, 2018 · 2 revisions

#set <varname> = <value>

Defines or redefines a jscc (compile-time) variable, aka varname.

To be valid, a varname must match the JavaScript regex /_[0-9A-Z][_0-9A-Z]*/ this is, it must start with an underscore, followed by one digit or uppercase letter, followed by zero or more underscores, digits or uppercase letters.

value can be a raw value, varname, or expression. If you don't specify the value, it is set to undefined.

#unset <varname>

Removes the definition of the given varname.

Both the definition or removal of a varname take immediate effect.

#if <expression>

Removes the block of code that follows this #if if expression is falsy.

You can nest multiple #if blocks.

#ifset <varname>

Check the existence of a varname.

The returned value is true if the variable exists, even if its value is undefined. Apart from this, the behavior of #ifset is the same as #if, so references to the latter will imply both.

#ifnset <varname>

This is the opposite to #ifset, it returns false if the varname does not exists.

#elif <expression>

The behavior of #elif is similar to the JS else if statement.

The expression will be evaluated if the previous #if or #elif was falsy.

You can have zero or more #elif directives following one #if.

#else

Includes the block that follows if the previous #if or #elif expressions were falsy.

#endif

Closes the current conditional block.

#error <expression>

Generates an exception at compile time with the result of the given character expression.

Clone this wiki locally