hispano-lang 1.0.0 → 1.0.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/README.md +1 -16
- package/bin/hispano.js +29 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
|
|
5
|
-

|
|
6
|
-
|
|
7
5
|
**Un lenguaje de programación educativo en español para enseñar programación sin barreras de idioma**
|
|
8
6
|
|
|
9
7
|
[](https://www.npmjs.com/package/hispano-lang)
|
|
@@ -21,7 +19,7 @@ La mayoría de los lenguajes de programación utilizan palabras clave en inglés
|
|
|
21
19
|
|
|
22
20
|
### ✨ Características principales:
|
|
23
21
|
|
|
24
|
-
-
|
|
22
|
+
- ✅ **Sintaxis 100% en español** - Sin barreras de idioma
|
|
25
23
|
- ⚡ **Intérprete completo** - Implementado en JavaScript/Node.js
|
|
26
24
|
- 🎓 **Minimalista** - Pensado para aprender lógica sin distracciones
|
|
27
25
|
- 📚 **Educativo** - Enfoque en conceptos fundamentales
|
|
@@ -261,19 +259,6 @@ npm test
|
|
|
261
259
|
|
|
262
260
|
## 🏗️ Arquitectura
|
|
263
261
|
|
|
264
|
-
```
|
|
265
|
-
src/
|
|
266
|
-
├── tokenizer.js # Análisis léxico
|
|
267
|
-
├── parser.js # Análisis sintáctico
|
|
268
|
-
├── evaluator.js # Evaluación de expresiones
|
|
269
|
-
└── interpreter.js # Orquestador principal
|
|
270
|
-
|
|
271
|
-
test/
|
|
272
|
-
└── test.js # Suite completa de tests
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
## 🏗️ Arquitectura
|
|
276
|
-
|
|
277
262
|
```
|
|
278
263
|
src/
|
|
279
264
|
├── tokenizer.js # Análisis léxico
|
package/bin/hispano.js
CHANGED
|
@@ -7,7 +7,28 @@
|
|
|
7
7
|
|
|
8
8
|
const fs = require('fs');
|
|
9
9
|
const path = require('path');
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
// Try to require from different possible locations
|
|
12
|
+
let hispanoLang;
|
|
13
|
+
try {
|
|
14
|
+
// Try from dist/ (when installed globally)
|
|
15
|
+
hispanoLang = require('../dist/index.js');
|
|
16
|
+
} catch (error1) {
|
|
17
|
+
try {
|
|
18
|
+
// Try from main.js (when running locally)
|
|
19
|
+
hispanoLang = require('../main.js');
|
|
20
|
+
} catch (error2) {
|
|
21
|
+
try {
|
|
22
|
+
// Try from current directory (fallback)
|
|
23
|
+
hispanoLang = require('./index.js');
|
|
24
|
+
} catch (error3) {
|
|
25
|
+
console.error('❌ Error: No se pudo cargar HispanoLang. Verifica la instalación.');
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const { interpret, run, getVariables, clearVariables, Interpreter } = hispanoLang;
|
|
11
32
|
|
|
12
33
|
// Colors for console output
|
|
13
34
|
const colors = {
|
|
@@ -231,13 +252,11 @@ function main() {
|
|
|
231
252
|
case '--help':
|
|
232
253
|
showHelp();
|
|
233
254
|
process.exit(0);
|
|
234
|
-
break;
|
|
235
255
|
|
|
236
256
|
case '-v':
|
|
237
257
|
case '--version':
|
|
238
258
|
showVersion();
|
|
239
259
|
process.exit(0);
|
|
240
|
-
break;
|
|
241
260
|
|
|
242
261
|
case '-i':
|
|
243
262
|
case '--interactive':
|
|
@@ -247,20 +266,24 @@ function main() {
|
|
|
247
266
|
case '-e':
|
|
248
267
|
case '--eval':
|
|
249
268
|
if (i + 1 < args.length) {
|
|
250
|
-
|
|
269
|
+
let code = args[i + 1];
|
|
270
|
+
// Handle multiple arguments for eval
|
|
271
|
+
if (i + 2 < args.length) {
|
|
272
|
+
// Join remaining arguments
|
|
273
|
+
const remainingArgs = args.slice(i + 1);
|
|
274
|
+
code = remainingArgs.join(' ');
|
|
275
|
+
}
|
|
251
276
|
executeCode(code, options);
|
|
252
277
|
process.exit(0);
|
|
253
278
|
} else {
|
|
254
279
|
console.error(`${colors.red}❌ Error: --eval requiere código${colors.reset}`);
|
|
255
280
|
process.exit(1);
|
|
256
281
|
}
|
|
257
|
-
break;
|
|
258
282
|
|
|
259
283
|
case '-t':
|
|
260
284
|
case '--test':
|
|
261
285
|
runTests();
|
|
262
286
|
process.exit(0);
|
|
263
|
-
break;
|
|
264
287
|
|
|
265
288
|
case '-d':
|
|
266
289
|
case '--debug':
|
package/package.json
CHANGED