How to use brs - 2 common examples

To help you get started, we’ve selected a few brs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sjbarag / brs / test / parser / ParserTests.js View on Github external
const brs = require("brs");
const { Lexeme } = brs.lexer;

/* A set of utilities to be used while writing tests for the BRS parser. */

/**
 * Creates a token with the given `kind` and (optional) `literal` value.
 * @param {Lexeme} kind the lexeme the produced token should represent.
 * @param {string} text the text represented by this token.
 * @param {*} [literal] the literal value that the produced token should contain, if any
 * @returns {object} a token of `kind` representing `text` with value `literal`.
 */
exports.token = function(kind, text, literal) {
    return {
        kind: kind,
        text: text,
        isReserved: brs.lexer.ReservedWords.has((text || "").toLowerCase()),
        literal: literal,
github sjbarag / brs / test / parser / ParserTests.js View on Github external
exports.token = function(kind, text, literal) {
    return {
        kind: kind,
        text: text,
        isReserved: brs.lexer.ReservedWords.has((text || "").toLowerCase()),
        literal: literal,
        location: {
            start: { line: -9, column: -9 },
            end: { line: -9, column: -9 },
        },
    };
};

brs

An interpreter for the BrightScript language that runs on non-Roku platforms.

MIT
Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis

Popular brs functions