hispano-lang 1.0.0 → 1.0.2

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 CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  <div align="center">
4
4
 
5
- ![HispanoLang Logo](https://img.shields.io/badge/HispanoLang-🇪🇸-blue?style=for-the-badge&logo=javascript)
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
  [![npm version](https://img.shields.io/npm/v/hispano-lang?style=flat-square)](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
- - 🇪✅ **Sintaxis 100% en español** - Sin barreras de idioma
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,38 @@
7
7
 
8
8
  const fs = require('fs');
9
9
  const path = require('path');
10
- const { interpret, run, getVariables, clearVariables, Interpreter } = require('../main.js');
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
+ try {
26
+ // Try from node_modules (when installed globally)
27
+ hispanoLang = require('hispano-lang');
28
+ } catch (error4) {
29
+ console.error('❌ Error: No se pudo cargar HispanoLang. Verifica la instalación.');
30
+ console.error('Rutas intentadas:');
31
+ console.error(' - ../dist/index.js');
32
+ console.error(' - ../main.js');
33
+ console.error(' - ./index.js');
34
+ console.error(' - hispano-lang');
35
+ process.exit(1);
36
+ }
37
+ }
38
+ }
39
+ }
40
+
41
+ const { interpret, run, getVariables, clearVariables, Interpreter } = hispanoLang;
11
42
 
12
43
  // Colors for console output
13
44
  const colors = {
@@ -231,13 +262,11 @@ function main() {
231
262
  case '--help':
232
263
  showHelp();
233
264
  process.exit(0);
234
- break;
235
265
 
236
266
  case '-v':
237
267
  case '--version':
238
268
  showVersion();
239
269
  process.exit(0);
240
- break;
241
270
 
242
271
  case '-i':
243
272
  case '--interactive':
@@ -247,20 +276,24 @@ function main() {
247
276
  case '-e':
248
277
  case '--eval':
249
278
  if (i + 1 < args.length) {
250
- const code = args[i + 1];
279
+ let code = args[i + 1];
280
+ // Handle multiple arguments for eval
281
+ if (i + 2 < args.length) {
282
+ // Join remaining arguments
283
+ const remainingArgs = args.slice(i + 1);
284
+ code = remainingArgs.join(' ');
285
+ }
251
286
  executeCode(code, options);
252
287
  process.exit(0);
253
288
  } else {
254
289
  console.error(`${colors.red}❌ Error: --eval requiere código${colors.reset}`);
255
290
  process.exit(1);
256
291
  }
257
- break;
258
292
 
259
293
  case '-t':
260
294
  case '--test':
261
295
  runTests();
262
296
  process.exit(0);
263
- break;
264
297
 
265
298
  case '-d':
266
299
  case '--debug':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hispano-lang",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Un lenguaje de programación educativo en español para enseñar programación sin barreras de idioma",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",