@designliquido/delegua 0.12.0 → 0.12.1
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/bin/package.json +1 -1
- package/execucao.js +15 -15
- package/execucao.js.map +1 -1
- package/fontes/delegua.js +2 -2
- package/fontes/depuracao/index.d.ts +1 -1
- package/fontes/depuracao/index.js +6 -1
- package/fontes/depuracao/index.js.map +1 -1
- package/fontes/interpretador/index.d.ts +1 -0
- package/fontes/interpretador/index.js +1 -0
- package/fontes/interpretador/index.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +3 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
package/bin/package.json
CHANGED
package/execucao.js
CHANGED
|
@@ -4,7 +4,7 @@ const delegua_1 = require("./fontes/delegua");
|
|
|
4
4
|
const commander_1 = require("commander");
|
|
5
5
|
const principal = () => {
|
|
6
6
|
const analisadorArgumentos = new commander_1.Command();
|
|
7
|
-
let
|
|
7
|
+
let codigoOuNomeArquivo;
|
|
8
8
|
analisadorArgumentos
|
|
9
9
|
.option('-c, --codigo <codigo>', 'Código a ser avaliado.', '')
|
|
10
10
|
.option('-d, --dialeto <dialeto>', 'Dialeto a ser usado. Padrão: delegua.', 'delegua')
|
|
@@ -13,28 +13,28 @@ const principal = () => {
|
|
|
13
13
|
.option('-s, --saida', 'Gera arquivo de saida ao traduzir arquivo.', false)
|
|
14
14
|
.option('-t, --traduzir <linguagem>', 'Traduz o código do arquivo passado como parâmetro.')
|
|
15
15
|
.argument('[arquivos...]', 'Nomes dos arquivos (opcional)')
|
|
16
|
-
.action((
|
|
17
|
-
if (
|
|
18
|
-
|
|
16
|
+
.action((argumentos) => {
|
|
17
|
+
if (argumentos.length > 0) {
|
|
18
|
+
codigoOuNomeArquivo = argumentos[0];
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
21
|
analisadorArgumentos.parse();
|
|
22
22
|
const opcoes = analisadorArgumentos.opts();
|
|
23
|
-
const delegua = new delegua_1.Delegua(opcoes.dialeto, opcoes.performance,
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
delegua.executarCodigoComoArgumento(opcoes.codigo);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
delegua.iniciarLairDelegua();
|
|
30
|
-
}
|
|
23
|
+
const delegua = new delegua_1.Delegua(opcoes.dialeto, opcoes.performance, codigoOuNomeArquivo ? opcoes.depurador : false, opcoes.traduzir);
|
|
24
|
+
if (opcoes.codigo) {
|
|
25
|
+
delegua.executarCodigoComoArgumento(opcoes.codigo || codigoOuNomeArquivo);
|
|
31
26
|
}
|
|
32
27
|
else {
|
|
33
|
-
if (
|
|
34
|
-
|
|
28
|
+
if (codigoOuNomeArquivo) {
|
|
29
|
+
if (opcoes.traduzir) {
|
|
30
|
+
delegua.traduzirArquivo(codigoOuNomeArquivo, opcoes.saida);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
delegua.carregarArquivo(codigoOuNomeArquivo);
|
|
34
|
+
}
|
|
35
35
|
}
|
|
36
36
|
else {
|
|
37
|
-
delegua.
|
|
37
|
+
delegua.iniciarLairDelegua();
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
};
|
package/execucao.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execucao.js","sourceRoot":"","sources":["../execucao.ts"],"names":[],"mappings":";;AAAA,8CAA2C;AAC3C,yCAAoC;AAEpC,MAAM,SAAS,GAAG,GAAG,EAAE;IACnB,MAAM,oBAAoB,GAAG,IAAI,mBAAO,EAAE,CAAC;IAC3C,IAAI,
|
|
1
|
+
{"version":3,"file":"execucao.js","sourceRoot":"","sources":["../execucao.ts"],"names":[],"mappings":";;AAAA,8CAA2C;AAC3C,yCAAoC;AAEpC,MAAM,SAAS,GAAG,GAAG,EAAE;IACnB,MAAM,oBAAoB,GAAG,IAAI,mBAAO,EAAE,CAAC;IAC3C,IAAI,mBAA2B,CAAC;IAEhC,oBAAoB;SAC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AAC,CAAC;AAEF,SAAS,EAAE,CAAC"}
|
package/fontes/delegua.js
CHANGED
|
@@ -130,10 +130,10 @@ class Delegua {
|
|
|
130
130
|
versao() {
|
|
131
131
|
try {
|
|
132
132
|
const manifesto = caminho.resolve(__dirname, 'package.json');
|
|
133
|
-
return JSON.parse(fs.readFileSync(manifesto, { encoding: 'utf8' })).version || '0.
|
|
133
|
+
return JSON.parse(fs.readFileSync(manifesto, { encoding: 'utf8' })).version || '0.12';
|
|
134
134
|
}
|
|
135
135
|
catch (error) {
|
|
136
|
-
return '0.
|
|
136
|
+
return '0.12 (desenvolvimento)';
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
/**
|
|
@@ -13,8 +13,13 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
13
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
16
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
20
|
+
exports.cyrb53 = void 0;
|
|
21
|
+
var cyrb53_1 = require("./cyrb53");
|
|
22
|
+
Object.defineProperty(exports, "cyrb53", { enumerable: true, get: function () { return __importDefault(cyrb53_1).default; } });
|
|
18
23
|
__exportStar(require("./ponto-parada"), exports);
|
|
19
24
|
__exportStar(require("./servidor-depuracao"), exports);
|
|
20
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../fontes/depuracao/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../fontes/depuracao/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,mCAA6C;AAApC,iHAAA,OAAO,OAAU;AAC1B,iDAA+B;AAC/B,uDAAqC"}
|
|
@@ -16,5 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./erro-interpretador"), exports);
|
|
18
18
|
__exportStar(require("./interpretador"), exports);
|
|
19
|
+
__exportStar(require("./interpretador-com-depuracao"), exports);
|
|
19
20
|
__exportStar(require("../interfaces/retornos/retorno-interpretador"), exports);
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../fontes/interpretador/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,kDAAgC;AAChC,+EAA6D"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../fontes/interpretador/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,kDAAgC;AAChC,gEAA8C;AAC9C,+EAA6D"}
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -14,8 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.cyrb53 = void 0;
|
|
17
18
|
__exportStar(require("./fontes/delegua"), exports);
|
|
18
19
|
__exportStar(require("./fontes/avaliador-sintatico"), exports);
|
|
20
|
+
var depuracao_1 = require("./fontes/depuracao");
|
|
21
|
+
Object.defineProperty(exports, "cyrb53", { enumerable: true, get: function () { return depuracao_1.cyrb53; } });
|
|
19
22
|
__exportStar(require("./fontes/formatadores"), exports);
|
|
20
23
|
__exportStar(require("./fontes/importador"), exports);
|
|
21
24
|
__exportStar(require("./fontes/interpretador"), exports);
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mDAAiC;AAEjC,+DAA6C;AAC7C,gDAAyD;AAAnC,mGAAA,MAAM,OAAA;AAC5B,wDAAsC;AACtC,sDAAoC;AACpC,yDAAuC;AACvC,mDAAiC"}
|
package/package.json
CHANGED