Tagscript

tagscript


Class: Interpreter

Defined in: Interpreter/Interpreter.ts:44

The TagScript interpreter.

Constructors

new Interpreter()

new Interpreter(...parsers): Interpreter

Defined in: Interpreter/Interpreter.ts:47

Parameters

parsers

...IParser[]

Returns

Interpreter

Properties

parsers

protected parsers: IParser[]

Defined in: Interpreter/Interpreter.ts:45

Methods

addParsers()

addParsers(...parsers): void

Defined in: Interpreter/Interpreter.ts:56

Add more parsers

Parameters

parsers

...IParser[]

The parsers to add.

Returns

void


getAcceptors()

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

Defined in: Interpreter/Interpreter.ts:94

Parameters

ctx

Context

Returns

Promise<IParser[]>


run()

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

Defined in: Interpreter/Interpreter.ts:80

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

The maximum characters to process.

null | number

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.

setParsers()

setParsers(...parsers): void

Defined in: Interpreter/Interpreter.ts:65

Set new parsers

Parameters

parsers

...IParser[]

The parsers to set.

Returns

void

On this page