"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getLineAndColumn = exports.isEscapedMustache = exports.isSafeMustache = exports.isMustache = exports.isEscapedTag = exports.isTag = void 0;
const types_1 = require("./types");
function isTag(token, name) {
    if (token.type === types_1.TagTypes.TAG || token.type === types_1.TagTypes.ETAG) {
        return name ? token.properties.name === name : true;
    }
    return false;
}
exports.isTag = isTag;
function isEscapedTag(token, name) {
    if (token.type === types_1.TagTypes.ETAG) {
        return name ? token.properties.name === name : true;
    }
    return false;
}
exports.isEscapedTag = isEscapedTag;
function isMustache(token) {
    return (token.type === types_1.MustacheTypes.EMUSTACHE ||
        token.type === types_1.MustacheTypes.ESMUSTACHE ||
        token.type === types_1.MustacheTypes.MUSTACHE ||
        token.type === types_1.MustacheTypes.SMUSTACHE);
}
exports.isMustache = isMustache;
function isSafeMustache(token) {
    return token.type === types_1.MustacheTypes.ESMUSTACHE || token.type === types_1.MustacheTypes.SMUSTACHE;
}
exports.isSafeMustache = isSafeMustache;
function isEscapedMustache(token) {
    return token.type === types_1.MustacheTypes.EMUSTACHE || token.type === types_1.MustacheTypes.ESMUSTACHE;
}
exports.isEscapedMustache = isEscapedMustache;
function getLineAndColumn(token) {
    if (token.type === 'newline' || token.type === 'raw') {
        return [token.line, 0];
    }
    return [token.loc.start.line, token.loc.start.col];
}
exports.getLineAndColumn = getLineAndColumn;
