Skip to content
Anton Zherdev edited this page May 30, 2014 · 1 revision

expression ::=
<number> | false | true | <string> | <tuple> | <array> | <map>
| <braces> | <if> | self | super | nil
| <unary_operation> | <binary_operation> | <set>
| <dot> | <null_safe_dot> | <call> | <index>
| <lambda> | <val> | <throw>
| <do> | <while> | <break> | <return>
| <case> | <synchronized> | <\weak> | <\try>

if ::= if(<expression>) <expression> else <expression>

Braces

braces ::= {
    <expression>
    <expression>
    ...
}

The return value is the return value of the last expression.

Unary operation

unary_operation ::= (! | -) <expression> | <expression> (++ | --)

if(!bar) foo++ else -foo

Binary operation

binary_operation ::= <expression> <\operation_type> <expression>
operation_type ::= + | - | * | / | && | || | == | === | != | !== | > | < | >= | <=

=== and !== - compare objects by pointer whereas == and != call isEqual function

Dot

dot ::= <expression>.<call>
null_safe_dot ::= <expression>?.<call>
call ::= name[(<call_parameter> [, <call_parameter> ...]) [<post_lambda>] ]
call_parameter ::= [parameter_name = ] <expression>

foo.f(a = 3, 4)

foo.functionWithoutArguments

Clone this wiki locally