Skip to content

Syntax Rules

Arda Özcan edited this page Sep 13, 2020 · 1 revision

Table of Contents

Syntax Rules

Statements

Statements are categorized operations that are performed by the interpreter. Statements are split by a new line token. Note that some statements can be longer than 1 line (e.g. If statements) but there must be a new line token before a new statement.

Examples of a statement can be:

  • Function definition
  • Function call
  • Assignment
  • Declaration
  • Import
  • Give
  • If

Code blocks

Code blocks are just a container for multiple (or single) statements. A specific definition for code blocks are not implemented in Boink so you can't see a code block syntax in a parsed syntax tree. Regardless, the concept of a code block is hardcoded in statements that can store an unknown number of other statements (such as a function definition). There is a general rule -followed by those statements which is to end code blocks with a semi colon ( ; ).

Examples of statements that store other statements:

  • Function definition
  • If

Indentation

Indentation is ignored since Boink parser doesn't care about white spaces but indenting function bodies, if statements etc. is recommended for easier readability.

Clone this wiki locally