lodash-template-js-parser
Version:
A JavaScript parser for lodash.template
104 lines • 4.15 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const token_1 = require("./token");
const node_1 = require("./node");
/**
* The template tag that is evaluated as script.
*/
class MicroTemplateEvaluate extends node_1.Node {
/**
* constructor.
* @param {number} startIndex The start index of range.
* @param {number} endIndex The end index of range.
* @param {SourceCodeStore} sourceCodeStore The sourceCodeStore.
* @param {object} optProps The optional property.
* @returns {void}
*/
constructor(startIndex, endIndex, sourceCodeStore, optProps) {
super("MicroTemplateEvaluate", startIndex, endIndex, sourceCodeStore, optProps);
this.type = "MicroTemplateEvaluate";
this.expressionStart = optProps && optProps.expressionStart;
this.expressionEnd = optProps && optProps.expressionEnd;
this.code = optProps && optProps.code;
}
}
exports.MicroTemplateEvaluate = MicroTemplateEvaluate;
/**
* The template tag that is interpolate as template.
*/
class MicroTemplateInterpolate extends node_1.Node {
/**
* constructor.
* @param {number} startIndex The start index of range.
* @param {number} endIndex The end index of range.
* @param {SourceCodeStore} sourceCodeStore The sourceCodeStore.
* @param {object} optProps The optional property.
* @returns {void}
*/
constructor(startIndex, endIndex, sourceCodeStore, optProps) {
super("MicroTemplateInterpolate", startIndex, endIndex, sourceCodeStore, optProps);
this.type = "MicroTemplateInterpolate";
this.expressionStart = optProps && optProps.expressionStart;
this.expressionEnd = optProps && optProps.expressionEnd;
this.code = optProps && optProps.code;
}
}
exports.MicroTemplateInterpolate = MicroTemplateInterpolate;
/**
* The template tag that is escapes to interpolate as template.
*/
class MicroTemplateEscape extends node_1.Node {
/**
* constructor.
* @param {number} startIndex The start index of range.
* @param {number} endIndex The end index of range.
* @param {SourceCodeStore} sourceCodeStore The sourceCodeStore.
* @param {object} optProps The optional property.
* @returns {void}
*/
constructor(startIndex, endIndex, sourceCodeStore, optProps) {
super("MicroTemplateEscape", startIndex, endIndex, sourceCodeStore, optProps);
this.type = "MicroTemplateEscape";
this.expressionStart = optProps && optProps.expressionStart;
this.expressionEnd = optProps && optProps.expressionEnd;
this.code = optProps && optProps.code;
}
}
exports.MicroTemplateEscape = MicroTemplateEscape;
/**
* The start tag of the template tag.
*/
class MicroTemplateExpressionStart extends token_1.Token {
/**
* constructor.
* @param {number} startIndex The start index of range.
* @param {number} endIndex The end index of range.
* @param {SourceCodeStore} sourceCodeStore The sourceCodeStore.
* @param {object} optProps The optional property.
* @returns {void}
*/
constructor(startIndex, endIndex, sourceCodeStore, optProps) {
super("MicroTemplateExpressionStart", startIndex, endIndex, sourceCodeStore, optProps);
this.chars = this.value;
}
}
exports.MicroTemplateExpressionStart = MicroTemplateExpressionStart;
/**
* The end tag of the template tag.
*/
class MicroTemplateExpressionEnd extends token_1.Token {
/**
* constructor.
* @param {number} startIndex The start index of range.
* @param {number} endIndex The end index of range.
* @param {SourceCodeStore} sourceCodeStore The sourceCodeStore.
* @param {object} optProps The optional property.
* @returns {void}
*/
constructor(startIndex, endIndex, sourceCodeStore, optProps) {
super("MicroTemplateExpressionEnd", startIndex, endIndex, sourceCodeStore, optProps);
this.chars = this.value;
}
}
exports.MicroTemplateExpressionEnd = MicroTemplateExpressionEnd;
//# sourceMappingURL=micro-template-nodes.js.map