DartBlockCustomFunction class

User-defined function with a list of statements to execute.

Custom functions are declared by the user in their DartBlock program and execute a sequence of Statements when called.

Inheritance
Implemented types
Annotations
  • @JsonSerializable.new(explicitToJson: true)

Constructors

DartBlockCustomFunction(String name, DartBlockDataType? returnType, List<DartBlockVariableDefinition> parameters, List<Statement> statements)
DartBlockCustomFunction.fromJson(Map<String, dynamic> json)
factory

Properties

hashCode int
The hash code for this object.
no setteroverride
name String
getter/setter pairinherited
parameters List<DartBlockVariableDefinition>
getter/setter pairinherited
returnType DartBlockDataType?
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statements List<Statement>
getter/setter pair

Methods

buildTree(DartBlockProgramTreeNode programTreeNode) DartBlockProgramTreeNode
override
copy() DartBlockCustomFunction
override
execute(DartBlockArbiter arbiter, List<DartBlockValue> args) DartBlockValue?
Execute the custom function by running its statements in a new scope. (Statement._execute handles scope management.)
override
getAsFunctionDefinition() FunctionDefinition
isMainFunction() bool
Whether it is the main function (entry point when executing DartBlockProgram).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shuffle({bool deep = false}) DartBlockCustomFunction
toJson() Map<String, dynamic>
toScript({DartBlockTypedLanguage language = DartBlockTypedLanguage.java}) String
override
toString() String
A string representation of this object.
inherited
trim(int length) DartBlockCustomFunction

Operators

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