Interp
hscript.Interp → ceramic.Interp (Class)
Custom HScript interpreter with Ceramic-specific functionality.
Extends the base interpreter to:
- Support ScriptModule method calls
- Automatically destroy entities created by scripts
- Catch and handle runtime errors gracefully
Instance Members
Creates a new interpreter for the given script.
Name | Type | Description |
---|---|---|
owner |
Script | Script that owns this interpreter |
Private Members
The Script instance that owns this interpreter
Handles function calls on objects. Special handling for ScriptModule to enable inter-script calls.
Name | Type | Description |
---|---|---|
o |
Dynamic | Object to call method on |
f |
String | Function name |
args |
Array<Dynamic> | Function arguments |
Returns | Description |
---|---|
Dynamic | Function result |
Gets a field value from an object. Special handling for ScriptModule to access exported variables.
Name | Type | Description |
---|---|---|
o |
Dynamic | Object to get field from |
f |
String | Field name |
Returns | Description |
---|---|
Dynamic | Field value |
Creates a new instance of a class.
Entities created by scripts are automatically destroyed when the script is destroyed, preventing memory leaks.
Name | Type | Description |
---|---|---|
cl |
String | Class name |
args |
Array<Dynamic> | Constructor arguments |
Returns | Description |
---|---|
Dynamic | New instance |
Executes a return expression with error handling.
Catches runtime errors to prevent scripts from crashing the application. Failed scripts are marked as broken and destroyed.
Name | Type | Description |
---|---|---|
e |
hscript.Expr | Expression to evaluate |
Returns | Description |
---|---|
Dynamic | Expression result or null if error |