Tagscript

Interpreter

TagScript


Class: Interpreter

Defined in: packages/tagscript/src/lib/Interpreter/Interpreter.ts:85

The TagScript interpreter.

Constructors

Constructor

new Interpreter(...parsers): Interpreter

Defined in: packages/tagscript/src/lib/Interpreter/Interpreter.ts:88

Parameters

parsers

...IParser[]

Returns

Interpreter

Properties

parsers

protected parsers: IParser[]

Defined in: packages/tagscript/src/lib/Interpreter/Interpreter.ts:86

Methods

addParsers()

addParsers(...parsers): void

Defined in: packages/tagscript/src/lib/Interpreter/Interpreter.ts:97

Add more parsers

Parameters

parsers

...IParser[]

The parsers to add.

Returns

void


getAcceptors()

protected getAcceptors(ctx): Promise<IParser[]>

Defined in: packages/tagscript/src/lib/Interpreter/Interpreter.ts:174

Parameters

ctx

Context

Returns

Promise<IParser[]>


run()

Call Signature

run(message, options?): Promise<Response>

Defined in: packages/tagscript/src/lib/Interpreter/Interpreter.ts:117

Processes a given TagScript string.

Parameters
message

string

The TagScript string that to be processed.

options?

RunOptions

The options for this render.

Returns

Promise<Response>

  • Response class containing the raw string, processed body, actions and variables.

Call Signature

run(message, seedVariables?, charLimit?, tagLimit?, parenType?, keyValues?): Promise<Response>

Defined in: packages/tagscript/src/lib/Interpreter/Interpreter.ts:131

Processes a given TagScript string.

Parameters
message

string

The TagScript string that to be processed.

seedVariables?

A object containing strings to transformer to provide context variables for processing.

charLimit?

number | null

The maximum characters to process.

tagLimit?

number

The maximum tags to process.

parenType?

ParenType

Whether the parameter should be followed after a "." or use parenthesis or both.

keyValues?

IKeyValues

Additional key value pairs that may be used by parsers during parsing.

Returns

Promise<Response>

  • Response class containing the raw string, processed body, actions and variables.
Deprecated

Pass a RunOptions object instead. This overload will be removed in the next major.


setParsers()

setParsers(...parsers): void

Defined in: packages/tagscript/src/lib/Interpreter/Interpreter.ts:106

Set new parsers

Parameters

parsers

...IParser[]

The parsers to set.

Returns

void

On this page