Class: MetaScript

MetaScript

new MetaScript(sourceOrProgram, filename)

Constructs a new MetaScript instance.

Parameters:
Name Type Argument Description
sourceOrProgram string

Source to compile or meta program to run

filename string <optional>

Source file name if known, defaults to "main".

Members

<static, constant> VERSION :string

MetaScript version.

filename :string

Original source file name.

program :string

The compiled meta program's source.

source :string

Original source.

Methods

<static> compile(source) → {string}

Compiles the specified source to a meta program and returns its source.

Parameters:
Name Type Description
source string

Source

Returns:

Meta program

Type
string

<static> transform(source, filename, scope) → {string}

Compiles the source to a meta program and transforms it using the specified scope in a new VM context.

Parameters:
Name Type Argument Description
source string

Source

filename string <optional>

Source file name

scope Object

Scope

Returns:

Transformed source

Type
string

transform(scope) → {string}

Transforms the meta program.

Parameters:
Name Type Description
scope Object

Scope

Returns:

Transformed source

Type
string