silegismg-interpretador-articulacao
Version:
Interpretador de Articulação
36 lines (35 loc) • 1.58 kB
JavaScript
;
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 Capitulo_1 = __importDefault(require("../../dispositivos/agrupadores/Capitulo"));
const Titulo_1 = __importDefault(require("../../dispositivos/agrupadores/Titulo"));
const ParserLinha_1 = __importDefault(require("./ParserLinha"));
class ParserCapitulo extends ParserLinha_1.default {
constructor() {
super(/^\s*CAP[ÍI]TULO\s*([IXVDLM]+(?:-[a-z])?)(?:\s*[-–]\s*(.+))?/i);
}
onMatch(contexto, m) {
const item = new Capitulo_1.default(m[1], m[2] || '');
contexto.adicionar([Titulo_1.default], item);
return item;
}
}
exports.default = ParserCapitulo;