jsish
Language Syntax
Not logged in

Syntax

The following syntax is implemented by Jsi (see Reference for commands):
continue [IDENT] ;
break [IDENT] ;
debugger ;
delete IDENT ;
do { STMTS; } while( EXPR ) ;
for ([var] IDENT = EXPR; EXPR; EXPR) { STMTS; }
for ([var] IDENT in EXPR) { STMTS; }
for ([var] IDENT of EXPR) { STMTS; }
function [IDENT] ([IDENT, IDENT, ...]) { STMTS; }
function [IDENT] ([IDENT:TYPE[=PRIMATIVE], IDENT:TYPE[=PRIMATIVE], ...]):TYPE { STMTS; }
if (EXPR) { STMTS; } [ else { STMTS; } ]
IDENT instanceof IDENT ;
[new] FUNC( ARGS ) ;
return [EXPR] ;
switch (EXPR) { case EXPR: STMTS; [break;] case EXPR: STMTS; [break;]  ... [default EXPR;] }
throw EXPR ;
try { EXPR; } catch(IDENT) { STMTS; } [finally { STMTS; }]
typeof EXPR ;
var IDENT [ = EXPR ] [, ...] ;
with ( EXPR ) { STMTS; }

Expressions

Expressions take the usual form:
IDENT.IDENT
IDENT[EXPR]
IDENT(ARGS)
(EXPR)
EXPR ? STMTS :  STMTS
STMTS , STMTS [, ...]
EXPR OP EXPR 

where OP is one of the binary operators +, -, *, /, etc.


Terminals

NameDescription
ARGSZero or more comma-seperated arguments
EXPR An expression (see below)
FUNCA function value
IDENT Is an valid identifier
PRIMITIVE A primitive value acceptable as an argument type.
STMTS Is zero or more statements
TYPEA type value acceptable as defaults

Keywords

Keywords can be displayed using Info.keywords():
[
  "...", "any", "arguments", "array", "boolean", "break", "case", "catch", 
  "continue", "debugger", "default", "delete", "do", "else", "false", 
  "finally", "for", "function", "if", "in", "instanceof", "new", "null", 
  "number", "object", "of", "regexp", "return", "string", "switch", 
  "this", "throw", "true", "try", "typeof", "undefined", "userobj", "var", 
  "void", "while", "with"
]