Crate roan_engine

Crate roan_engine 

Source

Re-exports§

pub use roan_error::error::RoanError::*;

Modules§

ast
context
interpreter
lexer
module
natives
parser
path
source
value
vm

Macros§

as_cast
entries
native_function

Structs§

AccessExpr
Represents an access expression in the AST. It includes accessing a field or indexing into a collection.
Assign
Represents an assignment expression in the AST. An assignment binds a value to a variable.
Ast
Represents the Abstract Syntax Tree (AST) for the language.
BinOperator
Represents a binary operator in the AST.
Binary
Represents a binary expression in the AST. A binary expression consists of two operands and an operator (e.g., a + b).
Block
Represents a block of statements enclosed in braces in the AST.
CallExpr
Represents a function call in the AST. It consists of a function name (callee) and a list of arguments.
Const
Diagnostic
Represents a diagnostic message, which includes information about an error or warning and can be pretty-printed to the console.
ElseBlock
Represents an else or else if block in the AST.
Fn
Represents a function declaration in the AST.
FnParam
Represents a function parameter in the AST.
FunctionType
Represents a function type annotation in the AST.
If
Represents an if statement in the AST.
Let
Represents a variable declaration (let statement) in the AST.
Lexer
The lexer is responsible for converting the source code into a list of tokens.
Literal
Represents a literal expression in the AST. It consists of a token and a specific literal value (e.g., integer, string).
Loop
ObjectExpr
Represents an object expression in the AST.
Parenthesized
Represents a parenthesized expression in the AST. Parenthesized expressions are used to override operator precedence.
Parser
A parser that converts a list of tokens into an Abstract Syntax Tree (AST).
Return
Represents a return statement in the AST.
Spread
Spread operator for variadic arguments.
Struct
StructConstructor
Represents a struct constructor expression in the AST.
StructField
StructImpl
TextSpan
Represents a span of text between two positions, including the literal text.
ThenElse
Represents a then-else expression in the AST.
Token
TraitDef
TraitImpl
Try
Represents a try statement in the AST.
TypeAnnotation
Represents a type annotation in the AST.
UnOperator
Represents a unary operator in the AST.
Unary
Represents a unary expression in the AST. Unary expressions operate on a single operand (e.g., -a).
Use
Represents a use statement for importing modules or items in the AST.
Variable
Represents a variable in the AST. A variable refers to a named entity in the program.
VecExpr
Represents a collection of expressions as a vector. Used to handle lists of expressions, such as arrays or argument lists.
While

Enums§

AccessKind
Enum representing the kind of access in an access expression.
AssignOperator
BinOpAssociativity
Enum representing the associativity of a binary operator.
BinOpKind
Enum representing the various binary operators in the language. Binary operators are used in binary expressions (e.g., a + b).
Expr
Enum representing an expression in the AST. Expressions include literals, binary operations, unary operations, and more.
LiteralType
Enum that defines the possible literal types in the language. Literals are constant values such as numbers, strings, and booleans.
ParseContext
Stmt
Represents a statement in the AST.
TokenKind
UnOpKind
Enum representing unary operator kinds (e.g., -, ~).

Traits§

GetSpan
A trait to get the source code position (span) of a node in the AST.

Functions§

print_diagnostic
Prints a diagnostic message based on the provided error. The function matches the error type with corresponding diagnostics and logs it prettily.