Skip to content
This repository was archived by the owner on Oct 9, 2023. It is now read-only.

Latest commit

 

History

History
297 lines (182 loc) · 6.2 KB

File metadata and controls

297 lines (182 loc) · 6.2 KB

Syntax

statement


LetStatement


MutStatement


TypeStatement


DeclareStatement


ReturnStatement


ReturnExpressionStatement


expression


AssignmentExpression

BlockExpression


InfixOperator


PrefixOperator


IfExpression


ElseClause


CallExpression


IndexExpression


TypeofExpression


Literal


Identifier

  • Identifier
    • a-z A-Z 0-9 _

NumberLiteral

  • NumberLiteral
    • 0-9 .

StringLiteral

  • StringLiteral
    • " string "

BooleanLiteral

  • BooleanLiteral
    • true | false

ArrayLiteral


FunctionLiteral


FunctionParameters
  • FunctionParameter
    • ParameterName4: ParameterType2

FunctionBlock

StructLiteral


StructLiteralFields

Types

Primitive Types

  • PrimitiveType
    • number | string | boolean | void

Sequence Types

ArrayType


FunctionType

  • FunctionType
    • fn 1 ( ParameterType26 ) -> ReturnType2

User Defined Types

StructType (StructStatement)


StructFields
  • StructField
    • FieldName4: FieldType2

Generics

  • GenericName4 < GenericParameters46 >

Comments

Single Line Comments

  • // Comment

Multi Line Comments

  • /* Comment */

Priorities

n Priority Operators
1 Lowest
2 Dot . ->
3 Equals = == !=
4 LessGreater < > <= >=
5 Sum + -
6 Product * /
7 Prefix ! -
8 Call ( )
9 Index [ ]

Footnotes

  1. keyword 2 3 4 5 6 7 8 9 10 11 12

  2. type 2 3 4 5 6 7 8 9

  3. optional 2 3 4 5 6

  4. identifier 2 3 4 5 6 7 8 9

  5. operator 2

  6. repeatable (ends with comma (,)) (can be empty) 2 3 4 5 6 7 8