Std mixin

Implements the lua standard libraries. Some implementations need further defining by the programmer such as Std.onRequireImpl called in initStdRequire.

The entry point is Std.initStdRuntime.

Superclass constraints

Properties

context LuaObject?
Shorthand for scope.context.
no setterinherited
debugPath String?
For diagnostics or debugging, what the current script path is. See onRequireImpl.
getter/setter pairinherited
global Scope
The global scope.
finalinherited
hasContext bool
Shorthand for scope.hasContext.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
onRequireImpl LuaRequireCallback?
Describes to do when lua processes the require() function.
getter/setter pairinherited
onRequireImplComplete ↔ dynamic Function(String)?
This is called by the closure defined in initStdRequire after the call to Std.onRequireImpl. In this way, programmers can configure the implementation details of require on a case-by-case basis (if needed) while still performing general book keeping for each.
getter/setter pair
results BaseResults
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scope Scope
The current scope.
getter/setter pairinherited

Methods

addDiagnostic(String info) → void
Build a meaningful diagnostic message from the current runtime information and original message info.
inherited
addError(String err) → void
Build a meaningful error message from the current runtime information and original message err.
inherited
addWarning(String warn) → void
Build a meaningful warning message from the current runtime information and original message warn.
inherited
callLuaFunction(LuaObject obj, {List<Object?> args = const []}) LuaObject?
Given a callable lua obj and a list of args, configure a new scope with the provided args as parameters based on the LuaObject.funcDef record. Args exceeding the parameter list will be dropped. Any remaining parameters will be filled by LuaObject.nil values. Any exceptions are caught and tracked for the trace back later. The scope is popped and any return result LuaObject is returned.
inherited
debugSetPath(String? path) → void
Setter for debugPath.
inherited
defGlobal(LuaObject value) LuaObject
Defines a global variable in the global scope with lua object value.
inherited
defLocal(LuaObject value) LuaObject
Defines a local variable in the current scope with lua object value.
inherited
findOnSelf(String field, {Object? or}) LuaObject?
First finds field inside object "self" in the current scope. If neither can be found, or is returned cast toLua. If or is not provided, null is returned.
inherited
findVar(String id) LuaObject?
Searches for a variable with the identifier id in the current scope. The implementation details also searches the parents in order if not found locally until such an id is found.
inherited
findVarArgs() List<LuaObject>?
Search the current scope for the special ... identifier.
inherited
initStdIPairs() → void
initStdMath() → void
initStdPairs() → void
initStdPrint({StdPrintCallback? impl}) → void
initStdRequire() → void
initStdRuntime() → void
initStdStrings() → void
initStdTable() → void
lineInfo(Token token) String
Given a Token, return that token's line information. This is useful for debugging.
inherited
lineTag(Token token) String
For variables, return (row, col) as a virtual identifier stub. This is useful for debugging.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
popScope() → void
If there exists Scope.parent, then tail adopts that. This effectively pops the scope of execution. Otherwise nothing happens.
inherited
pushScope({LuaObject? context}) → void
A reverse linked list implementation where tail points towards head (the parent chain). Calling this function adds a new Scope node in the linked list as the new tail and sets scope to point to the latest tail node. Every node points to its Scope.parent.
inherited
tokenId(Token token, {String? prefix}) String
Given a Token, construct a lua identifier stub. If prefix is non null, then the stub will have that prefix.
inherited
toString() String
A string representation of this object.
inherited
visitAssignExpr(AssignExpr assignExpr) Object?
inherited
visitAssignMultiExpr(AssignMultiExpr assignMultiExpr) Object?
inherited
visitAST(AST ast) Object?
The starting point of all lua programs. This will visit every node in the tree. The default result will be a program which ran to completion.
inherited
visitBinaryExpr(BinaryExpr expr) Object?
inherited
visitBooleanLiteral(BooleanLiteral boolean) Object?
inherited
visitBreakStmt(BreakStmt stmt) Object?
inherited
visitDeclArg(DeclArg declArg) Object?
inherited
visitDeclMultiVar(DeclMultiVar declMultiVar) Object?
inherited
visitDeclVar(DeclVar declVar) Object?
inherited
visitForIterLoopStmt(ForIterLoopStmt forIterLoopStmt) Object?
inherited
visitForLoopStmt(ForLoopStmt forLoopStmt) Object?
inherited
visitFuncExpr(FuncExpr expr) Object?
inherited
visitGotoLabelStmt(GotoLabelStmt stmt) Object?
inherited
visitGotoStmt(GotoStmt stmt) Object?
inherited
visitGroupExpr(GroupExpr groupExpr) Object?
inherited
visitIfStmt(IfStmt stmt) Object?
inherited
visitKeyValStmt(KeyValStmt keyval) Object?
inherited
visitMemoryAccess(MemoryAccess memoryAccess) Object?
inherited
visitNilLiteral(NilLiteral nil) Object?
inherited
visitNotExpr(NotExpr notExpr) Object?
inherited
visitNumberLiteral(NumberLiteral number) Object?
inherited
visitRawExpr(RawExpr rawExpr) Object?
inherited
visitRepeatUntilLoopStmt(RepeatUntilLoopStmt repeatUntilLoopStmt) Object?
inherited
visitReturnStmt(ReturnStmt expr) Object?
inherited
visitSelfExpr(SelfExpr selfExpr) Object?
inherited
visitStringLiteral(StringLiteral string) Object?
inherited
visitTableLiteral(TableLiteral table) Object?
inherited
visitUnaryExpr(UnaryExpr expr) Object?
inherited
visitWhileLoopStmt(WhileLoopStmt whileLoopStmt) Object?
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited