UNPKG

silegismg-interpretador-articulacao

Version:
35 lines (34 loc) 1.52 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); /* Copyright 2019 Assembleia Legislativa de Minas Gerais * * This file is part of Interpretador-Articulacao. * * Interpretador-Articulacao is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, version 3. * * Interpretador-Articulacao is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with Interpretador-Articulacao. If not, see <http://www.gnu.org/licenses/>. */ const EscapeInterpretacao_1 = __importDefault(require("./EscapeInterpretacao")); /** * Escapa o símbolo de substituição de escape. */ class EscapeSimboloEscape extends EscapeInterpretacao_1.default { escapar(entrada, aoEscapar) { for (let idx = entrada.indexOf(EscapeInterpretacao_1.default.ESCAPE); idx !== -1; idx = entrada.indexOf(EscapeInterpretacao_1.default.ESCAPE, idx + 1)) { aoEscapar(EscapeInterpretacao_1.default.ESCAPE, idx); } return entrada; } } exports.default = EscapeSimboloEscape;