@designliquido/foles 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/fontes/avaliador-sintatico/avaliador-sintatico-reverso.d.ts +4 -2
- package/fontes/avaliador-sintatico/avaliador-sintatico-reverso.js +59 -11
- package/fontes/avaliador-sintatico/avaliador-sintatico-reverso.js.map +1 -1
- package/fontes/avaliador-sintatico/avaliador-sintatico.js +0 -1
- package/fontes/avaliador-sintatico/avaliador-sintatico.js.map +1 -1
- package/fontes/foles.js +4 -3
- package/fontes/foles.js.map +1 -1
- package/fontes/lexador/palavras-reservadas/css.d.ts +451 -34
- package/fontes/lexador/palavras-reservadas/css.js +472 -41
- package/fontes/lexador/palavras-reservadas/css.js.map +1 -1
- package/fontes/lexador/palavras-reservadas/foles.d.ts +9 -9
- package/fontes/lexador/palavras-reservadas/foles.js +9 -10
- package/fontes/lexador/palavras-reservadas/foles.js.map +1 -1
- package/fontes/modificadores/aparencia.js +1 -1
- package/fontes/modificadores/aparencia.js.map +1 -1
- package/fontes/modificadores/atributos/gerais.js +1 -0
- package/fontes/modificadores/atributos/gerais.js.map +1 -1
- package/fontes/modificadores/cor-borda.js +1 -1
- package/fontes/modificadores/cor-borda.js.map +1 -1
- package/fontes/modificadores/margem-superior.js +1 -0
- package/fontes/modificadores/margem-superior.js.map +1 -1
- package/fontes/modificadores/superclasse/seletor-reverso-modificador.d.ts +1 -1
- package/fontes/modificadores/superclasse/seletor-reverso-modificador.js +2 -2
- package/fontes/modificadores/superclasse/seletor-reverso-modificador.js.map +1 -1
- package/fontes/modificadores/validacoes/comum.js +20 -5
- package/fontes/modificadores/validacoes/comum.js.map +1 -1
- package/fontes/modificadores/validacoes/condicao-extra.js +20 -5
- package/fontes/modificadores/validacoes/condicao-extra.js.map +1 -1
- package/fontes/modificadores/validacoes/cor.js +21 -9
- package/fontes/modificadores/validacoes/cor.js.map +1 -1
- package/fontes/modificadores/validacoes/fonte.js +11 -2
- package/fontes/modificadores/validacoes/fonte.js.map +1 -1
- package/fontes/modificadores/validacoes/multiplos-qualitativos.js +22 -7
- package/fontes/modificadores/validacoes/multiplos-qualitativos.js.map +1 -1
- package/fontes/modificadores/validacoes/numerica.js +30 -6
- package/fontes/modificadores/validacoes/numerica.js.map +1 -1
- package/fontes/pseudoclasses/n-ultimo-tipo.js +1 -1
- package/fontes/pseudoclasses/n-ultimo-tipo.js.map +1 -1
- package/fontes/resolvedores/resolvedor-reverso.d.ts +9 -2
- package/fontes/resolvedores/resolvedor-reverso.js +135 -37
- package/fontes/resolvedores/resolvedor-reverso.js.map +1 -1
- package/fontes/tipos-de-simbolos/css.d.ts +4 -0
- package/fontes/tipos-de-simbolos/css.js +4 -0
- package/fontes/tipos-de-simbolos/css.js.map +1 -1
- package/package.json +1 -1
- package/testes/listas/traducao-reversa.js +0 -4
- package/testes/listas/traducao-reversa.js.map +1 -1
- package/testes/resolvedor-reverso.test.js +4 -8
- package/testes/resolvedor-reverso.test.js.map +1 -1
|
@@ -14,22 +14,40 @@ function validarValorNumerico(nomePropriedade, valores, valoresAceitos, valoresE
|
|
|
14
14
|
if (quantificadoresAceitos && valorModificador.numerico && valorNumericoTipado.quantificador) {
|
|
15
15
|
(0, quantificador_1.validarQuantificador)(nomePropriedade, valorNumericoTipado.quantificador, quantificadoresAceitos);
|
|
16
16
|
}
|
|
17
|
+
let valoresCss = [];
|
|
18
|
+
if (valoresAceitos) {
|
|
19
|
+
valoresCss = Object.values(valoresAceitos);
|
|
20
|
+
}
|
|
21
|
+
const valoresGlobaisCss = Object.values(globais_1.valoresGlobais);
|
|
22
|
+
valoresGlobaisCss.forEach((valor) => valoresCss.push(valor));
|
|
17
23
|
if (valoresAceitos === null && valoresExtra === null) {
|
|
18
24
|
if (typeof valorModificador.valor !== 'number' &&
|
|
25
|
+
!(valoresCss.includes(valorModificador.valor)) &&
|
|
19
26
|
!(valorModificador.valor in globais_1.valoresGlobais)) {
|
|
20
27
|
throw new Error(`Modificador ou variável '${nomePropriedade}' com valor ${valorModificador.valor} inválido. Valores aceitos:
|
|
21
|
-
número-quantificador (ex.: 12px)
|
|
22
|
-
|
|
28
|
+
número-quantificador (ex.: 12px);
|
|
29
|
+
|
|
30
|
+
Valores Foles aceitos:
|
|
31
|
+
${Object.keys(globais_1.valoresGlobais).reduce((final, atual) => (final += `, ${atual}`))}.
|
|
32
|
+
|
|
33
|
+
Valores CSS aceitos:
|
|
34
|
+
${valoresCss.reduce((final, atual) => (final += `, ${atual}`))}.`);
|
|
23
35
|
}
|
|
24
36
|
}
|
|
25
37
|
if (valoresAceitos !== null && valoresExtra === null) {
|
|
26
38
|
if (typeof valorModificador.valor !== 'number' &&
|
|
27
39
|
!(valorModificador.valor in valoresAceitos) &&
|
|
40
|
+
!(valoresCss.includes(valorModificador.valor)) &&
|
|
28
41
|
!(valorModificador.valor in globais_1.valoresGlobais)) {
|
|
29
42
|
throw new Error(`Modificador ou variável '${nomePropriedade}' com valor ${valorModificador.valor} inválido. Valores aceitos:
|
|
30
|
-
número-quantificador (ex.: 12px)
|
|
43
|
+
número-quantificador (ex.: 12px);
|
|
44
|
+
|
|
45
|
+
Valores FolEs aceitos:
|
|
31
46
|
${Object.keys(valoresAceitos).reduce((final, atual) => (final += `, ${atual}`))},
|
|
32
|
-
${Object.keys(globais_1.valoresGlobais).reduce((final, atual) => (final += `, ${atual}`))}
|
|
47
|
+
${Object.keys(globais_1.valoresGlobais).reduce((final, atual) => (final += `, ${atual}`))}.
|
|
48
|
+
|
|
49
|
+
Valores CSS aceitos:
|
|
50
|
+
${valoresCss.reduce((final, atual) => (final += `, ${atual}`))}.`);
|
|
33
51
|
}
|
|
34
52
|
}
|
|
35
53
|
if (valoresAceitos !== null && valoresExtra !== null) {
|
|
@@ -43,13 +61,19 @@ function validarValorNumerico(nomePropriedade, valores, valoresAceitos, valoresE
|
|
|
43
61
|
}
|
|
44
62
|
if (typeof valorModificador.valor !== 'number' &&
|
|
45
63
|
!(valorModificador.valor in valoresAceitos) &&
|
|
64
|
+
!(valoresCss.includes(valorModificador.valor)) &&
|
|
46
65
|
!metodoValido &&
|
|
47
66
|
!(valorModificador.valor in globais_1.valoresGlobais)) {
|
|
48
67
|
throw new Error(`Modificador ou variável '${nomePropriedade}' com valor ${valorModificador.valor} inválido. Valores aceitos:
|
|
49
|
-
número-quantificador (ex.: 12px)
|
|
68
|
+
número-quantificador (ex.: 12px);
|
|
69
|
+
|
|
70
|
+
Valores FolEs aceitos:
|
|
50
71
|
${Object.keys(valoresAceitos).reduce((final, atual) => (final += `, ${atual}`))},
|
|
51
72
|
${valoresExtra.reduce((final, atual) => (final += `, ${atual}`))},
|
|
52
|
-
${Object.keys(globais_1.valoresGlobais).reduce((final, atual) => (final += `, ${atual}`))}
|
|
73
|
+
${Object.keys(globais_1.valoresGlobais).reduce((final, atual) => (final += `, ${atual}`))}.
|
|
74
|
+
|
|
75
|
+
Valores CSS aceitos:
|
|
76
|
+
${valoresCss.reduce((final, atual) => (final += `, ${atual}`))}.`);
|
|
53
77
|
}
|
|
54
78
|
}
|
|
55
79
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numerica.js","sourceRoot":"","sources":["../../../../fontes/modificadores/validacoes/numerica.ts"],"names":[],"mappings":";;AAMA,
|
|
1
|
+
{"version":3,"file":"numerica.js","sourceRoot":"","sources":["../../../../fontes/modificadores/validacoes/numerica.ts"],"names":[],"mappings":";;AAMA,oDA2FC;AAhGD,kDAAsD;AACtD,qDAAiD;AACjD,mEAA+D;AAC/D,mDAAuD;AAEvD,SAAgB,oBAAoB,CAChC,eAAuB,EACvB,OAAgB,EAChB,cAAiD,EACjD,YAAkB,EAClB,sBAAyD,EACzD,yBAAkC,KAAK;IAEvC,MAAM,gBAAgB,GAAmE,IAAA,8BAAa,EAAC,OAAO,CAAC,CAAC;IAEhH,MAAM,mBAAmB,GAAG,OAAO,CAAC,CAAC,CAAkB,CAAC;IACxD,IAA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or(pragmas) {
|
|
7
|
-
super("n-ultimo-tipo", "nth-
|
|
7
|
+
super("n-ultimo-tipo", "nth-last-type", pragmas);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
exports.NUltimoTipo = NUltimoTipo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"n-ultimo-tipo.js","sourceRoot":"","sources":["../../../fontes/pseudoclasses/n-ultimo-tipo.ts"],"names":[],"mappings":";;;AAAA,iDAAmE;AAEnE,MAAa,WAAY,SAAQ,2BAAY;IACzC,YAAY,OAA6B;QACrC,KAAK,CAAC,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"n-ultimo-tipo.js","sourceRoot":"","sources":["../../../fontes/pseudoclasses/n-ultimo-tipo.ts"],"names":[],"mappings":";;;AAAA,iDAAmE;AAEnE,MAAa,WAAY,SAAQ,2BAAY;IACzC,YAAY,OAA6B;QACrC,KAAK,CAAC,eAAe,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;CACJ;AAJD,kCAIC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Declaracao } from "../declaracoes";
|
|
1
|
+
import { BlocoDeclaracao, Declaracao, DeclaracaoVariavel } from "../declaracoes";
|
|
2
2
|
import { Modificador } from "../modificadores";
|
|
3
3
|
import { Valor } from "../valores";
|
|
4
4
|
/**
|
|
@@ -7,8 +7,15 @@ import { Valor } from "../valores";
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class ResolvedorReverso {
|
|
9
9
|
resolverComAninhamentos: boolean;
|
|
10
|
+
variaveis: {
|
|
11
|
+
[key: string]: Valor[];
|
|
12
|
+
};
|
|
10
13
|
constructor(resolverComAninhamentos?: boolean);
|
|
11
|
-
protected resolverValor(valor: Valor
|
|
14
|
+
protected resolverValor(valor: Valor, valoresAceitos?: {
|
|
15
|
+
[valorFoles: string]: string;
|
|
16
|
+
}): string;
|
|
12
17
|
resolverModificador(modificador: Modificador, indentacao?: number): string;
|
|
18
|
+
resolverDeclaracaoVariavel(declaracaoVariavel: DeclaracaoVariavel): void;
|
|
19
|
+
resolverBlocoDeclaracao(declaracao: BlocoDeclaracao, indentacao: number, textoSeletorAnterior: string): string;
|
|
13
20
|
resolver(declaracoes: Declaracao[], indentacao?: number, seletorAnterior?: string): string;
|
|
14
21
|
}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.ResolvedorReverso = void 0;
|
|
4
|
-
const
|
|
7
|
+
const estrutura_1 = require("../estruturas/estrutura");
|
|
8
|
+
const gerais_1 = require("../modificadores/atributos/gerais");
|
|
9
|
+
const seletor_espaco_reservado_1 = require("../seletores/seletor-espaco-reservado");
|
|
10
|
+
const estruturas_lmht_1 = __importDefault(require("../tradutores/estruturas-lmht"));
|
|
5
11
|
const metodo_css_1 = require("../valores/metodos/css/metodo-css");
|
|
6
12
|
const metodo_1 = require("../valores/metodos/foles/metodo");
|
|
7
13
|
/**
|
|
@@ -11,24 +17,134 @@ const metodo_1 = require("../valores/metodos/foles/metodo");
|
|
|
11
17
|
class ResolvedorReverso {
|
|
12
18
|
constructor(resolverComAninhamentos = true) {
|
|
13
19
|
this.resolverComAninhamentos = resolverComAninhamentos;
|
|
20
|
+
this.variaveis = {};
|
|
14
21
|
}
|
|
15
|
-
resolverValor(valor) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
resolverValor(valor, valoresAceitos) {
|
|
23
|
+
switch (valor.constructor.name) {
|
|
24
|
+
case 'ReferenciaVariavel':
|
|
25
|
+
const valorReferenciaVariavel = valor;
|
|
26
|
+
const valoresVariavelCorrespondente = this.variaveis[valorReferenciaVariavel.nomeVariavel];
|
|
27
|
+
if (valoresVariavelCorrespondente === undefined) {
|
|
28
|
+
throw new Error(`A variável '${valorReferenciaVariavel.nomeVariavel}' deve ser declarada antes da atribuição de valor.`);
|
|
29
|
+
}
|
|
30
|
+
let valoresVariavelResolvidos = "";
|
|
31
|
+
for (const valorVariavel of valoresVariavelCorrespondente) {
|
|
32
|
+
const valorResolvido = this.resolverValor(valorVariavel);
|
|
33
|
+
if (valorResolvido === ",") {
|
|
34
|
+
valoresVariavelResolvidos = valoresVariavelResolvidos.slice(0, -1);
|
|
35
|
+
}
|
|
36
|
+
valoresVariavelResolvidos += valorResolvido + " ";
|
|
37
|
+
}
|
|
38
|
+
valoresVariavelResolvidos = valoresVariavelResolvidos.slice(0, -1);
|
|
39
|
+
return valoresVariavelResolvidos;
|
|
40
|
+
case 'ValorAbreviacao':
|
|
41
|
+
return "/";
|
|
42
|
+
case 'ValorNumerico':
|
|
43
|
+
const valorNumerico = valor;
|
|
44
|
+
let literalNumerico = String(valorNumerico.literalNumerico);
|
|
45
|
+
if ((valorNumerico.quantificador) &&
|
|
46
|
+
(valorNumerico.literalNumerico < 1 && valorNumerico.literalNumerico > 0)) {
|
|
47
|
+
literalNumerico = literalNumerico.replace(/^0\./, '.');
|
|
48
|
+
}
|
|
49
|
+
return `${literalNumerico}${valorNumerico.quantificador || ''}`;
|
|
50
|
+
case 'ValorQualitativo':
|
|
51
|
+
const valorQualitativo = valor;
|
|
52
|
+
const valoresHtml = Object.values(gerais_1.valoresGerais);
|
|
53
|
+
let traducaoQualitativo = undefined;
|
|
54
|
+
traducaoQualitativo = valoresHtml.find((valor) => valor === valorQualitativo.qualitativo);
|
|
55
|
+
if (!traducaoQualitativo) {
|
|
56
|
+
traducaoQualitativo = Object.values(valoresAceitos).find((valor) => valor === valorQualitativo.qualitativo);
|
|
57
|
+
}
|
|
58
|
+
if (!traducaoQualitativo)
|
|
59
|
+
traducaoQualitativo = valorQualitativo.qualitativo;
|
|
60
|
+
return `${traducaoQualitativo}`;
|
|
61
|
+
case 'ValorTexto':
|
|
62
|
+
const valorTexto = valor;
|
|
63
|
+
return valorTexto.literalTexto;
|
|
64
|
+
case 'ValorVirgula':
|
|
65
|
+
return ",";
|
|
66
|
+
default:
|
|
67
|
+
// Valor é RGB, RGBA, HSL, HSLA ou HEX, ou seja, um método.
|
|
68
|
+
if (valor instanceof metodo_css_1.MetodoCss || valor instanceof metodo_1.Metodo) {
|
|
69
|
+
return valor.paraTexto();
|
|
70
|
+
}
|
|
71
|
+
throw new Error(JSON.stringify(valor) + " não é um valor válido para resolução.");
|
|
21
72
|
}
|
|
22
|
-
return String(valor);
|
|
23
73
|
}
|
|
24
74
|
resolverModificador(modificador, indentacao = 0) {
|
|
25
|
-
let
|
|
75
|
+
let valoresTraduzidos = "";
|
|
26
76
|
for (const valor of modificador.valores) {
|
|
27
|
-
|
|
77
|
+
let valoresAceitos = null;
|
|
78
|
+
if (modificador.valoresAceitos)
|
|
79
|
+
valoresAceitos = modificador.valoresAceitos;
|
|
80
|
+
const valorResolvido = this.resolverValor(valor, valoresAceitos);
|
|
81
|
+
if (valorResolvido === ",") {
|
|
82
|
+
valoresTraduzidos = valoresTraduzidos.slice(0, -1);
|
|
83
|
+
}
|
|
84
|
+
valoresTraduzidos += valorResolvido + " ";
|
|
28
85
|
}
|
|
29
|
-
|
|
86
|
+
valoresTraduzidos = valoresTraduzidos.slice(0, -1);
|
|
30
87
|
return (" ".repeat(indentacao) +
|
|
31
|
-
`${Array.isArray(modificador.nomeFoles) ? modificador.nomeFoles[0] : modificador.nomeFoles}: ${
|
|
88
|
+
`${Array.isArray(modificador.nomeFoles) ? modificador.nomeFoles[0] : modificador.nomeFoles}: ${valoresTraduzidos};\n`);
|
|
89
|
+
}
|
|
90
|
+
resolverDeclaracaoVariavel(declaracaoVariavel) {
|
|
91
|
+
this.variaveis[declaracaoVariavel.nome] = declaracaoVariavel.valores;
|
|
92
|
+
}
|
|
93
|
+
resolverBlocoDeclaracao(declaracao, indentacao, textoSeletorAnterior) {
|
|
94
|
+
let resultado = "";
|
|
95
|
+
const prefixos = [];
|
|
96
|
+
let deveImprimir = true;
|
|
97
|
+
for (const seletor of declaracao.seletores) {
|
|
98
|
+
if (seletor instanceof seletor_espaco_reservado_1.SeletorEspacoReservado) {
|
|
99
|
+
deveImprimir = false;
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
let prefixo;
|
|
103
|
+
if (seletor instanceof estrutura_1.Estrutura) {
|
|
104
|
+
if (seletor.pseudoclasse) {
|
|
105
|
+
const seletorHtml = seletor.tagHtml;
|
|
106
|
+
const seletorSemPseudoclasse = seletorHtml.split(":")[0];
|
|
107
|
+
const traducaoSeletor = estruturas_lmht_1.default[seletorSemPseudoclasse][0];
|
|
108
|
+
const traducaoPseudoclasse = seletor.pseudoclasse.pseudoclasseCss;
|
|
109
|
+
prefixo = (textoSeletorAnterior +
|
|
110
|
+
" " +
|
|
111
|
+
`${traducaoSeletor}:${traducaoPseudoclasse}`).trimStart();
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
const seletorLmht = seletor.tagHtml;
|
|
115
|
+
const traducaoSeletor = estruturas_lmht_1.default[seletorLmht][0];
|
|
116
|
+
prefixo = (textoSeletorAnterior +
|
|
117
|
+
" " +
|
|
118
|
+
traducaoSeletor).trimStart();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
prefixo = (textoSeletorAnterior +
|
|
123
|
+
" " +
|
|
124
|
+
seletor.paraTexto()).trimStart();
|
|
125
|
+
}
|
|
126
|
+
prefixos.push(prefixo);
|
|
127
|
+
resultado += " ".repeat(indentacao) + prefixo + ", ";
|
|
128
|
+
}
|
|
129
|
+
if (!deveImprimir) {
|
|
130
|
+
return resultado;
|
|
131
|
+
}
|
|
132
|
+
resultado = resultado.slice(0, -2);
|
|
133
|
+
resultado += " {\n";
|
|
134
|
+
for (const modificador of declaracao.modificadores) {
|
|
135
|
+
resultado += this.resolverModificador(modificador, indentacao + 4);
|
|
136
|
+
}
|
|
137
|
+
if (this.resolverComAninhamentos) {
|
|
138
|
+
resultado += this.resolver(declaracao.declaracoesAninhadas, indentacao + 4);
|
|
139
|
+
resultado += `${" ".repeat(indentacao)}}\n\n`;
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
resultado += `${" ".repeat(indentacao)}}\n\n`;
|
|
143
|
+
for (const prefixo of prefixos) {
|
|
144
|
+
resultado += this.resolver(declaracao.declaracoesAninhadas, indentacao, prefixo);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return resultado;
|
|
32
148
|
}
|
|
33
149
|
resolver(declaracoes, indentacao = 0, seletorAnterior = undefined) {
|
|
34
150
|
let resultado = "";
|
|
@@ -37,33 +153,15 @@ class ResolvedorReverso {
|
|
|
37
153
|
textoSeletorAnterior = seletorAnterior;
|
|
38
154
|
}
|
|
39
155
|
for (const declaracao of declaracoes) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
resultado += " ".repeat(indentacao) + prefixo + ", ";
|
|
48
|
-
}
|
|
49
|
-
resultado = resultado.slice(0, -2);
|
|
50
|
-
resultado += " {\n";
|
|
51
|
-
for (const modificador of declaracao.modificadores) {
|
|
52
|
-
resultado += this.resolverModificador(modificador, indentacao + 4);
|
|
53
|
-
}
|
|
54
|
-
if (this.resolverComAninhamentos) {
|
|
55
|
-
resultado += this.resolver(declaracao.declaracoesAninhadas, indentacao + 4);
|
|
56
|
-
resultado += `${" ".repeat(indentacao)}}\n\n`;
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
resultado += `${" ".repeat(indentacao)}}\n\n`;
|
|
60
|
-
for (const prefixo of prefixos) {
|
|
61
|
-
resultado += this.resolver(declaracao.declaracoesAninhadas, indentacao, prefixo);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
156
|
+
switch (declaracao.constructor.name) {
|
|
157
|
+
case "BlocoDeclaracao":
|
|
158
|
+
resultado += this.resolverBlocoDeclaracao(declaracao, indentacao, textoSeletorAnterior);
|
|
159
|
+
break;
|
|
160
|
+
case "DeclaracaoVariavel":
|
|
161
|
+
this.resolverDeclaracaoVariavel(declaracao);
|
|
162
|
+
break;
|
|
64
163
|
}
|
|
65
164
|
}
|
|
66
|
-
// TODO: Adicionar caso if (declaracao instanceof DeclaracaoVariavel)
|
|
67
165
|
return resultado;
|
|
68
166
|
}
|
|
69
167
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvedor-reverso.js","sourceRoot":"","sources":["../../../fontes/resolvedores/resolvedor-reverso.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolvedor-reverso.js","sourceRoot":"","sources":["../../../fontes/resolvedores/resolvedor-reverso.ts"],"names":[],"mappings":";;;;;;AACA,uDAAoD;AAEpD,8DAAkE;AAClE,oFAA+E;AAC/E,oFAA2D;AAE3D,kEAA8D;AAC9D,4DAAyD;AAGzD;;;GAGG;AACH,MAAa,iBAAiB;IAI1B,YAAY,0BAAmC,IAAI;QAC/C,IAAI,CAAC,uBAAuB,GAAG,uBAAuB,CAAC;QACvD,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;IACxB,CAAC;IAES,aAAa,CACnB,KAAY,EACZ,cAAiD;QAEjD,QAAQ,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;YAC7B,KAAK,oBAAoB;gBACrB,MAAM,uBAAuB,GAAG,KAA2B,CAAC;gBAC5D,MAAM,6BAA6B,GAAG,IAAI,CAAC,SAAS,CAAC,uBAAuB,CAAC,YAAY,CAAC,CAAC;gBAC3F,IAAI,6BAA6B,KAAK,SAAS,EAAE,CAAC;oBAC9C,MAAM,IAAI,KAAK,CAAC,eAAe,uBAAuB,CAAC,YAAY,oDAAoD,CAAC,CAAC;gBAC7H,CAAC;gBAED,IAAI,yBAAyB,GAAG,EAAE,CAAC;gBACnC,KAAK,MAAM,aAAa,IAAI,6BAA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AAE,CAAC;gBAC7B,SAAS,IAAI,IAAI,CAAC,QAAQ,CACtB,UAAU,CAAC,oBAAoB,EAC/B,UAAU,EACV,OAAO,CACV,CAAC;YACN,CAAC;QACL,CAAC;QAED,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,QAAQ,CACJ,WAAyB,EACzB,aAAqB,CAAC,EACtB,kBAA0B,SAAS;QAEnC,IAAI,SAAS,GAAG,EAAE,CAAC;QACnB,IAAI,oBAAoB,GAAG,EAAE,CAAC;QAC9B,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;YAChC,oBAAoB,GAAG,eAAe,CAAC;QAC3C,CAAC;QAED,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;YACnC,QAAQ,UAAU,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;gBAClC,KAAK,iBAAiB;oBAClB,SAAS,IAAI,IAAI,CAAC,uBAAuB,CACrC,UAA6B,EAC7B,UAAU,EACV,oBAAoB,CACvB,CAAC;oBACF,MAAM;gBACV,KAAK,oBAAoB;oBACrB,IAAI,CAAC,0BAA0B,CAC3B,UAAgC,CACnC,CAAC;oBACF,MAAM;YACd,CAAC;QACL,CAAC;QAED,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ;AAjOD,8CAiOC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
ATRIBUTO: string;
|
|
3
|
+
BARRA: string;
|
|
3
4
|
CERQUILHA: string;
|
|
4
5
|
CHAVE_DIREITA: string;
|
|
5
6
|
CHAVE_ESQUERDA: string;
|
|
7
|
+
CIFRAO: string;
|
|
6
8
|
CLASSE: string;
|
|
7
9
|
COLCHETE_DIREITO: string;
|
|
8
10
|
COLCHETE_ESQUERDO: string;
|
|
@@ -17,8 +19,10 @@ declare const _default: {
|
|
|
17
19
|
PERCENTUAL: string;
|
|
18
20
|
PONTO: string;
|
|
19
21
|
PONTO_E_VIRGULA: string;
|
|
22
|
+
PSEUDO_CLASSE: string;
|
|
20
23
|
QUALITATIVO: string;
|
|
21
24
|
QUANTIFICADOR: string;
|
|
25
|
+
TEXTO: string;
|
|
22
26
|
TIL: string;
|
|
23
27
|
VIRGULA: string;
|
|
24
28
|
};
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = {
|
|
4
4
|
ATRIBUTO: "ATRIBUTO",
|
|
5
|
+
BARRA: "BARRA",
|
|
5
6
|
CERQUILHA: "CERQUILHA",
|
|
6
7
|
CHAVE_DIREITA: "CHAVE_DIREITA",
|
|
7
8
|
CHAVE_ESQUERDA: "CHAVE_ESQUERDA",
|
|
9
|
+
CIFRAO: "CIFRAO",
|
|
8
10
|
CLASSE: "CLASSE",
|
|
9
11
|
COLCHETE_DIREITO: "COLCHETE_DIREITO",
|
|
10
12
|
COLCHETE_ESQUERDO: "COLCHETE_ESQUERDO",
|
|
@@ -19,8 +21,10 @@ exports.default = {
|
|
|
19
21
|
PERCENTUAL: "PERCENTUAL",
|
|
20
22
|
PONTO: "PONTO",
|
|
21
23
|
PONTO_E_VIRGULA: "PONTO_E_VIRGULA",
|
|
24
|
+
PSEUDO_CLASSE: "PSEUDO_CLASSE",
|
|
22
25
|
QUALITATIVO: "QUALITATIVO",
|
|
23
26
|
QUANTIFICADOR: "QUANTIFICADOR",
|
|
27
|
+
TEXTO: "TEXTO",
|
|
24
28
|
TIL: "TIL",
|
|
25
29
|
VIRGULA: "VIRGULA",
|
|
26
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css.js","sourceRoot":"","sources":["../../../fontes/tipos-de-simbolos/css.ts"],"names":[],"mappings":";;AAAA,kBAAe;IACX,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;IACtB,aAAa,EAAE,eAAe;IAC9B,cAAc,EAAE,gBAAgB;IAChC,MAAM,EAAE,QAAQ;IAChB,gBAAgB,EAAE,kBAAkB;IACpC,iBAAiB,EAAE,mBAAmB;IACtC,WAAW,EAAE,aAAa;IAC1B,GAAG,EAAE,KAAK;IACV,aAAa,EAAE,eAAe;IAC9B,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,kBAAkB,EAAE,oBAAoB;IACxC,iBAAiB,EAAE,mBAAmB;IACtC,UAAU,EAAE,YAAY;IACxB,KAAK,EAAE,OAAO;IACd,eAAe,EAAE,iBAAiB;IAClC,WAAW,EAAE,aAAa;IAC1B,aAAa,EAAE,eAAe;IAC9B,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,SAAS;CACrB,CAAC"}
|
|
1
|
+
{"version":3,"file":"css.js","sourceRoot":"","sources":["../../../fontes/tipos-de-simbolos/css.ts"],"names":[],"mappings":";;AAAA,kBAAe;IACX,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,WAAW;IACtB,aAAa,EAAE,eAAe;IAC9B,cAAc,EAAE,gBAAgB;IAChC,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,gBAAgB,EAAE,kBAAkB;IACpC,iBAAiB,EAAE,mBAAmB;IACtC,WAAW,EAAE,aAAa;IAC1B,GAAG,EAAE,KAAK;IACV,aAAa,EAAE,eAAe;IAC9B,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,kBAAkB,EAAE,oBAAoB;IACxC,iBAAiB,EAAE,mBAAmB;IACtC,UAAU,EAAE,YAAY;IACxB,KAAK,EAAE,OAAO;IACd,eAAe,EAAE,iBAAiB;IAClC,aAAa,EAAE,eAAe;IAC9B,WAAW,EAAE,aAAa;IAC1B,aAAa,EAAE,eAAe;IAC9B,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,SAAS;CACrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traducao-reversa.js","sourceRoot":"","sources":["../../../testes/listas/traducao-reversa.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAkB;IAC1C;QACI,KAAK,EAAE,uBAAuB;QAC9B,GAAG,EAAE,qBAAqB;KAC7B;IACD;QACI,KAAK,EAAE,mBAAmB;QAC1B,GAAG,EAAE,gBAAgB;KACxB;IACD;QACI,KAAK,EAAE,kBAAkB;QACzB,GAAG,EAAE,eAAe;KACvB;IACD;QACI,KAAK,EAAE,wBAAwB;QAC/B,GAAG,EAAE,sBAAsB;KAC9B;IACD;QACI,KAAK,EAAE
|
|
1
|
+
{"version":3,"file":"traducao-reversa.js","sourceRoot":"","sources":["../../../testes/listas/traducao-reversa.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAkB;IAC1C;QACI,KAAK,EAAE,uBAAuB;QAC9B,GAAG,EAAE,qBAAqB;KAC7B;IACD;QACI,KAAK,EAAE,mBAAmB;QAC1B,GAAG,EAAE,gBAAgB;KACxB;IACD;QACI,KAAK,EAAE,kBAAkB;QACzB,GAAG,EAAE,eAAe;KACvB;IACD;QACI,KAAK,EAAE,wBAAwB;QAC/B,GAAG,EAAE,sBAAsB;KAC9B;IACD;QACI,KAAK,EAAE,+BAA+B;QACtC,GAAG,EAAE,sBAAsB;KAC9B;IACD;QACI,KAAK,EAAE,+BAA+B;QACtC,GAAG,EAAE,oBAAoB;KAC5B;IACD;QACI,KAAK,EAAE,8BAA8B;QACrC,GAAG,EAAE,qBAAqB;KAC7B;IACD;QACI,KAAK,EAAE,+BAA+B;QACtC,GAAG,EAAE,mBAAmB;KAC3B;IACD;QACI,KAAK,EAAE,WAAW;QAClB,GAAG,EAAE,UAAU;KAClB;IACD;QACI,KAAK,EAAE,sBAAsB;QAC7B,GAAG,EAAE,cAAc;KACtB;IACD;QACI,KAAK,EAAE,YAAY;QACnB,GAAG,EAAE,eAAe;KACvB;IACD;QACI,KAAK,EAAE,OAAO;QACd,GAAG,EAAE,SAAS;KACjB;IACD;QACI,KAAK,EAAE,eAAe;QACtB,GAAG,EAAE,aAAa;KACrB;CACJ,CAAC"}
|
|
@@ -20,8 +20,7 @@ describe('Resolvedor Reverso', () => {
|
|
|
20
20
|
avaliadorReverso = new avaliador_sintatico_reverso_1.AvaliadorSintaticoReverso(importador);
|
|
21
21
|
resolvedorReverso = new resolvedor_reverso_1.ResolvedorReverso();
|
|
22
22
|
});
|
|
23
|
-
|
|
24
|
-
it.skip('Testando tradução das estruturas HTML', () => {
|
|
23
|
+
it('Testando tradução das estruturas HTML', () => {
|
|
25
24
|
for (let index = 0; index < Object.keys(estruturas_lmht_1.default).length; index += 1) {
|
|
26
25
|
// Lexador recebe as estruturas FolEs
|
|
27
26
|
const resultadoLexador = lexadorReverso.mapear([
|
|
@@ -43,8 +42,7 @@ describe('Resolvedor Reverso', () => {
|
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
44
|
});
|
|
46
|
-
|
|
47
|
-
it.skip('Testando tradução reversa de modificadores', () => {
|
|
45
|
+
it('Testando tradução reversa de modificadores', () => {
|
|
48
46
|
for (let index = 0; index < Object.keys(traducao_reversa_1.TraducaoReversa).length; index += 1) {
|
|
49
47
|
// Lexador Reverso recebe as estruturas FolEs
|
|
50
48
|
const resultadoLexador = lexadorReverso.mapear([
|
|
@@ -62,9 +60,7 @@ describe('Resolvedor Reverso', () => {
|
|
|
62
60
|
expect(resultadoResolvedor).toContain('60px;');
|
|
63
61
|
}
|
|
64
62
|
});
|
|
65
|
-
|
|
66
|
-
// TODO: Implementar lista de métodos quando estiver funcionando
|
|
67
|
-
it.skip('Testando tradução reversa de métodos', () => {
|
|
63
|
+
it('Testando tradução reversa de métodos', () => {
|
|
68
64
|
// Lexador Reverso recebe as estruturas FolEs
|
|
69
65
|
const resultadoLexador = lexadorReverso.mapear([
|
|
70
66
|
`html {`,
|
|
@@ -78,7 +74,7 @@ describe('Resolvedor Reverso', () => {
|
|
|
78
74
|
// Resolvedor reverso deve retornar a estrutura HTML correspondente
|
|
79
75
|
expect(resultadoResolvedor).toContain('lmht');
|
|
80
76
|
expect(resultadoResolvedor).toContain('borrar');
|
|
81
|
-
expect(resultadoResolvedor).toContain('4px
|
|
77
|
+
expect(resultadoResolvedor).toContain('4px');
|
|
82
78
|
});
|
|
83
79
|
});
|
|
84
80
|
//# sourceMappingURL=resolvedor-reverso.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvedor-reverso.test.js","sourceRoot":"","sources":["../../testes/resolvedor-reverso.test.ts"],"names":[],"mappings":";;;;;AAAA,2GAAsG;AACtG,uEAAmE;AACnE,kFAA8E;AAC9E,2FAAkE;AAElE,qDAAkD;AAClD,gEAA4D;AAE5D,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAChC,IAAI,cAAgC,CAAC;IACrC,IAAI,UAA+B,CAAC;IACpC,IAAI,gBAA6C,CAAC;IAClD,IAAI,iBAAoC,CAAC;IAEzC,UAAU,CAAC,GAAG,EAAE;QACZ,cAAc,GAAG,IAAI,gCAAc,EAAE,CAAC;QACtC,UAAU,GAAG,IAAI,uBAAU,CAAC,cAAc,CAAC,CAAC;QAC5C,gBAAgB,GAAG,IAAI,uDAAyB,CAAC,UAAU,CAAC,CAAC;QAC7D,iBAAiB,GAAG,IAAI,sCAAiB,EAAE,CAAC;IAChD,CAAC,CAAC,CAAC;IAEH,
|
|
1
|
+
{"version":3,"file":"resolvedor-reverso.test.js","sourceRoot":"","sources":["../../testes/resolvedor-reverso.test.ts"],"names":[],"mappings":";;;;;AAAA,2GAAsG;AACtG,uEAAmE;AACnE,kFAA8E;AAC9E,2FAAkE;AAElE,qDAAkD;AAClD,gEAA4D;AAE5D,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAChC,IAAI,cAAgC,CAAC;IACrC,IAAI,UAA+B,CAAC;IACpC,IAAI,gBAA6C,CAAC;IAClD,IAAI,iBAAoC,CAAC;IAEzC,UAAU,CAAC,GAAG,EAAE;QACZ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