Tagscript

StopParser

The stop tag stops tag processing if the given parameter evaluates to true. If a message is passed to the payload, it will return that message instead of an empty string. This tag throws an error to halt all further processing, unlike the BreakParser which only affects the current tag output.

Usage

import { Interpreter, StopParser } from 'tagscript';
const ts = new Interpreter(new StopParser());
const { Interpreter, StopParser } = require('tagscript');
const ts = new Interpreter(new StopParser());

API

Check StopParser for the API documentation.

For End Users

Syntax

{stop(expression):message}

Examples

{stop({args}!=10):You didn't provide valid input.}
# if {args} is not 10
You didn't provide valid input.
# if {args} is 10
# Processing continues normally
{stop({user.id}==12345):Access denied for this user.}

Aliases

halt, stop, error

Last updated on