Script

NodeAstNodeloreline.Script (Class)

Represents the root node of a Loreline script AST.

Static Members

fromJson(json: Dynamic): Script

Reconstructs a Script from its JSON representation.

Name Type Description
json Dynamic The JSON object (as returned by script.toJson())
Returns Description
Script The reconstructed Script

Instance Members

indentSize: Int

The detected indentation size of the source (e.g., 2 or 4 spaces).


filePath: String

The file path this script was parsed from. May be null if the script was parsed without a file path.


Array of top-level declarations in the script.


toJson(): Dynamic

Converts the script to a JSON representation.

Returns Description
Dynamic Dynamic object containing all script data

type(): String
Returns
String

eachExcludingImported(handleNode: Function): Void
Name Type
handleNode Function

each(handleNode: Function): Void
Name Type
handleNode Function

Returns
loreline._Script.ScriptBodyIterator

new(id: NodeId, pos: Position, body: Array<AstNode>): Void

Creates a new script root node.

Name Type Description
id NodeId The node id of this script
pos Position Position in source where this script starts
body Array<AstNode> Array of top-level declarations

Metadata

Name Parameters
:expose -