Entry point of the program, contains only a call to cli() and the modules declaration.
Contains the REPL, the file runner and all things with user interaction.
The error type and the error macro.
Contains the Lexer
code and the Token
enumeration definition.
The Lexer
takes a String
and returns a Vec<Token>
.
Contains the Parser
, a hand made recursive parser, the Literal
enumeration definition (an enumeration for describing literal types, such as Integer
, Single
or String
), the Pattern
enumeration definition (an enumeration for describing match
arms, with Tuple
, Constr
, Var
and Literal
variants) and the Expr
enumearation definition.
The Parser
takes a Vec<Token>
and returns a Vec<Expr>
.
Contains the Compiler
, that takes a Vec<Expr>
and returns a Bytecode
.
Contains the Bytecode
struct, containing the matches
, the Chunk
s, the symbols
, the constants
, the BytecodePattern
s, the OpCode
s and the constructors
.
matches
::Vec<Vec<(u16, Vec<OpCode>)>>
: Thematch
expressions, each one being aVec<(u16, Vec<OpCode>)>
. Each element of this Vec has a pattern ID (theu16
), part of thepatterns
field of theBytecode
and an instruction set, that are theOpCode
s being executed when the pattern is matched.Chunk
s ::Vec<Chunk>
: Thechunks
of the bytecode, that represent the functions bodies. Each chunk is constitued of a referenceVec<u16>
, representing the ID in thesymbols
of theBytecode
of each of the arguments, and of an instruction set,Vec<OpCode>
, composing the function body.symbols
::Vec<String>
: The symbol table of the bytecode, contaning the name of each variable, that is replace by an ID (u16
) in the instructions, for size and efficiency reasons.constants
::Vec<Literal>
: The constants table, containing the constants needed by the program, refered by ID for the same reasons as above.BytecodePattern
s ::Vec<BytecodePattern>
: The pattern table of the bytecode.BytecodePattern
is the same asPattern
but with 2 exceptions: It uses IDs instead of recursive patterns and it has theOtherwise
variant, for the_
variable.OpCode
s ::Vec<OpCode>
: The bytecode instructions.constructors
::Vec<u8>
: The bytecode constructors, eachu8
represents the amount of values contained in the constructor.
The Orion Virtual Machine, containing the Value
enumeration declaration and the whole virtual machine.
The maths builtins.
The Orion standard library and prelude.