Expression syntax

Literals

  • Numeric literals

    Any C# numeric literal is supported, including literals with a type suffix like 12.6m (decimal), 6.0f (float). Scientific notation is also supported, e.g. 12.4e-5

  • String literals (surrounded by ")
  • Character literals (surrounded by ')
  • true, false, null

Operators

  • + - * /
  • % ^ & |
  • > < == >= <= !=
  • && ||
  • ( )

Range operators

Range operators are specific to Iridium Script. The arguments of the operator should be integers and the return value is a list of integers:

  • ... : inclusive range. For example 1...10 returns a list with numbers 1 to 10 (inclusive)
  • <...: right inclusive. The left number is not included in the range
  • ...>: left inclusive. The right number is not included in the range
  • <...>: exclusive: Both left and right numbers are not included in the range

Object access

  • object.Property
  • object.Method()

Indexers

  • [...]. The type of the indexer can be anything, just like in C#

Type cast

  • (TYPE)expression
  • expression as TYPE

Type checking

  • is. Usage: obj is type