Tagscript

Class: Interpreter

The TagScript interpreter.

Constructors

new Interpreter()

new Interpreter(...parsers): Interpreter

Parameters

• ...parsers: IParser[]

Returns

Interpreter

Defined in

Interpreter/Interpreter.ts:47

Properties

parsers

protected parsers: IParser[]

Defined in

Interpreter/Interpreter.ts:45

Methods

addParsers()

addParsers(...parsers): void

Add more parsers

Parameters

• ...parsers: IParser[]

The parsers to add.

Returns

void

Defined in

Interpreter/Interpreter.ts:56


getAcceptors()

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

Parameters

ctx: Context

Returns

Promise<IParser[]>

Defined in

Interpreter/Interpreter.ts:94


run()

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

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: null | number = null

The maximum characters to process.

tagLimit: number = 2_000

The maximum tags to process.

parenType: ParenType = ParenType.Both

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.

Defined in

Interpreter/Interpreter.ts:80


setParsers()

setParsers(...parsers): void

Set new parsers

Parameters

• ...parsers: IParser[]

The parsers to set.

Returns

void

Defined in

Interpreter/Interpreter.ts:65

On this page