hispano-lang 1.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Nicolas Vazquez
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,404 @@
1
+ # HispanoLang
2
+
3
+ <div align="center">
4
+
5
+ ![HispanoLang Logo](https://img.shields.io/badge/HispanoLang-🇪🇸-blue?style=for-the-badge&logo=javascript)
6
+
7
+ **Un lenguaje de programación educativo en español para enseñar programación sin barreras de idioma**
8
+
9
+ [![npm version](https://img.shields.io/npm/v/hispano-lang?style=flat-square)](https://www.npmjs.com/package/hispano-lang)
10
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)
11
+ [![Node.js Version](https://img.shields.io/node/v/hispano-lang?style=flat-square)](https://nodejs.org/)
12
+ [![Downloads](https://img.shields.io/npm/dm/hispano-lang?style=flat-square)](https://www.npmjs.com/package/hispano-lang)
13
+
14
+ [📖 Documentación](#documentación) • [🚀 Instalación](#instalación) • [💻 Uso](#uso) • [📚 Ejemplos](#ejemplos) • [🤝 Contribuir](#contribuir)
15
+
16
+ </div>
17
+
18
+ ## 🎯 ¿Por qué HispanoLang?
19
+
20
+ La mayoría de los lenguajes de programación utilizan palabras clave en inglés, lo que puede dificultar el aprendizaje para principiantes hispanohablantes. **HispanoLang** propone una sintaxis sencilla en español, enfocada en aprender conceptos esenciales de programación.
21
+
22
+ ### ✨ Características principales:
23
+
24
+ - 🇪✅ **Sintaxis 100% en español** - Sin barreras de idioma
25
+ - ⚡ **Intérprete completo** - Implementado en JavaScript/Node.js
26
+ - 🎓 **Minimalista** - Pensado para aprender lógica sin distracciones
27
+ - 📚 **Educativo** - Enfoque en conceptos fundamentales
28
+ - 🔧 **CLI Tool** - Interfaz de línea de comandos intuitiva
29
+ - 🧪 **Suite de tests** - 170+ tests para garantizar calidad
30
+ - 📦 **NPM Package** - Fácil instalación y distribución
31
+ - 🔄 **REPL Interactivo** - Modo interactivo para experimentar
32
+ - 📝 **TypeScript Support** - Definiciones de tipos incluidas
33
+ - 🌍 **Open Source** - Libre para usar, modificar y contribuir
34
+
35
+ ## 🚀 Instalación
36
+
37
+ ### Prerrequisitos
38
+
39
+ - **Node.js** >= 20.0.0
40
+ - **npm** o **yarn**
41
+
42
+ ### Instalación Global (Recomendada)
43
+
44
+ ```bash
45
+ npm install -g hispano-lang
46
+ ```
47
+
48
+ ### Instalación Local
49
+
50
+ ```bash
51
+ npm install hispano-lang
52
+ ```
53
+
54
+ ### Instalación desde Código Fuente
55
+
56
+ ```bash
57
+ git clone https://github.com/nicvazquezdev/hispano-lang.git
58
+ cd hispano-lang
59
+ npm install
60
+ npm run build
61
+ ```
62
+
63
+ ## 💻 Uso
64
+
65
+ ### CLI Tool
66
+
67
+ Una vez instalado globalmente, puedes usar HispanoLang desde cualquier lugar:
68
+
69
+ ```bash
70
+ # Modo interactivo (REPL)
71
+ hispano
72
+
73
+ # Ejecutar archivo
74
+ hispano script.hl
75
+
76
+ # Ejecutar código directamente
77
+ hispano -e "mostrar 'Hola mundo'"
78
+
79
+ # Ver ayuda
80
+ hispano --help
81
+
82
+ # Ejecutar tests
83
+ hispano --test
84
+ ```
85
+
86
+ ### Como Módulo Node.js
87
+
88
+ ```javascript
89
+ const { interpret, run, getVariables } = require('hispano-lang');
90
+
91
+ // Interpretar código
92
+ const result = interpret(`
93
+ variable nombre = "Juan"
94
+ mostrar "Hola " + nombre
95
+ `);
96
+
97
+ console.log(result.output); // ['Hola Juan']
98
+
99
+ // Ejecutar y obtener salidas
100
+ const outputs = run(`
101
+ variable x = 10
102
+ mostrar x * 2
103
+ `);
104
+
105
+ console.log(outputs); // ['20']
106
+ ```
107
+
108
+ ### TypeScript
109
+
110
+ ```typescript
111
+ import { interpret, InterpretationResult } from 'hispano-lang';
112
+
113
+ const result: InterpretationResult = interpret(`
114
+ variable edad = 25
115
+ si edad >= 18 {
116
+ mostrar "Es mayor de edad"
117
+ }
118
+ `);
119
+ ```
120
+
121
+ ## 📚 Sintaxis de HispanoLang
122
+
123
+ ### 🎯 Ejemplo Rápido
124
+
125
+ ```javascript
126
+ // Saludo personalizado
127
+ variable nombre = "María"
128
+ mostrar "¡Hola " + nombre + "!"
129
+
130
+ // Calculadora simple
131
+ variable a = 10
132
+ variable b = 5
133
+ variable suma = a + b
134
+ mostrar "La suma es: " + suma
135
+
136
+ // Condicional
137
+ si suma > 10 {
138
+ mostrar "¡Es un número grande!"
139
+ } sino {
140
+ mostrar "Es un número pequeño"
141
+ }
142
+ ```
143
+
144
+ ### Variables
145
+
146
+ ```javascript
147
+ variable nombre = "Juan"
148
+ variable edad = 25
149
+ variable activo = verdadero
150
+ variable salario = 50000.50
151
+ ```
152
+
153
+ ### Entrada de datos
154
+
155
+ ```javascript
156
+ // Entrada básica
157
+ leer nombre
158
+ mostrar "Hola " + nombre
159
+
160
+ // Entrada con mensaje
161
+ leer edad "¿Cuál es tu edad?"
162
+ mostrar "Tienes " + edad + " años"
163
+ ```
164
+
165
+ ### Condicionales
166
+
167
+ ```javascript
168
+ si edad >= 18 {
169
+ mostrar "Es mayor de edad"
170
+ } sino {
171
+ mostrar "Es menor de edad"
172
+ }
173
+ ```
174
+
175
+ ### Bucles
176
+
177
+ ```javascript
178
+ // Bucle mientras
179
+ variable i = 0
180
+ mientras i < 5 {
181
+ mostrar i
182
+ i = i + 1
183
+ }
184
+
185
+ // Bucle para
186
+ para variable j = 0; j < 3; j = j + 1 {
187
+ mostrar j
188
+ }
189
+ ```
190
+
191
+ ### Funciones
192
+
193
+ ```javascript
194
+ funcion saludar(nombre) {
195
+ retornar "Hola " + nombre
196
+ }
197
+
198
+ mostrar saludar("Mundo")
199
+ ```
200
+
201
+ ### Arrays
202
+
203
+ ```javascript
204
+ variable frutas = ["manzana", "banana", "naranja"]
205
+ mostrar frutas.longitud() // 3
206
+ mostrar frutas.primero() // manzana
207
+ mostrar frutas.ultimo() // naranja
208
+
209
+ // Métodos de array
210
+ frutas.agregar("uva") // push
211
+ frutas.remover() // pop
212
+ frutas.contiene("banana") // includes
213
+ ```
214
+
215
+ ### Objetos
216
+
217
+ ```javascript
218
+ variable persona = {
219
+ nombre: "Juan",
220
+ edad: 30,
221
+ ciudad: "Madrid"
222
+ }
223
+
224
+ mostrar persona.nombre // Juan
225
+ persona.edad = 31 // Modificar propiedad
226
+ ```
227
+
228
+ ### Strings
229
+
230
+ ```javascript
231
+ variable texto = "hola mundo"
232
+ mostrar texto.longitud() // 10
233
+ mostrar texto.mayusculas() // HOLA MUNDO
234
+ mostrar texto.minusculas() // hola mundo
235
+ ```
236
+
237
+ ### Manejo de errores
238
+
239
+ ```javascript
240
+ intentar {
241
+ variable x = 10 / 0
242
+ } capturar (error) {
243
+ mostrar "Error: " + error
244
+ }
245
+ ```
246
+
247
+ ### Valores especiales
248
+
249
+ ```javascript
250
+ variable valorNulo = nulo
251
+ variable valorIndefinido = indefinido
252
+ ```
253
+
254
+ ## 🧪 Testing
255
+
256
+ El proyecto incluye una suite completa de tests con más de 170 casos:
257
+
258
+ ```bash
259
+ npm test
260
+ ```
261
+
262
+ ## 🏗️ Arquitectura
263
+
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
+ ```
278
+ src/
279
+ ├── tokenizer.js # Análisis léxico
280
+ ├── parser.js # Análisis sintáctico
281
+ ├── evaluator.js # Evaluación de expresiones
282
+ └── interpreter.js # Orquestador principal
283
+
284
+ bin/
285
+ └── hispano.js # CLI tool
286
+
287
+ test/
288
+ └── test.js # Suite completa de tests (170+ casos)
289
+ ```
290
+
291
+ ## 🛠️ Desarrollo
292
+
293
+ ### Configuración del entorno
294
+
295
+ ```bash
296
+ # Clonar el repositorio
297
+ git clone https://github.com/nicvazquezdev/hispano-lang.git
298
+ cd hispano-lang
299
+
300
+ # Instalar dependencias
301
+ npm install
302
+
303
+ # Ejecutar en modo desarrollo
304
+ npm run dev
305
+
306
+ # Ejecutar tests
307
+ npm test
308
+
309
+ # Linting y formato
310
+ npm run lint
311
+ npm run format
312
+
313
+ # Build para producción
314
+ npm run build
315
+ ```
316
+
317
+ ### Scripts disponibles
318
+
319
+ - `npm start` - Ejecutar el intérprete
320
+ - `npm test` - Ejecutar tests
321
+ - `npm run dev` - Modo desarrollo con nodemon
322
+ - `npm run lint` - Verificar código con ESLint
323
+ - `npm run format` - Formatear código con Prettier
324
+ - `npm run build` - Construir para producción
325
+ - `npm run demo` - Ejecutar demo
326
+
327
+ ## 🤝 Contribuir
328
+
329
+ ¡Las contribuciones son bienvenidas! Este proyecto está abierto a la comunidad.
330
+
331
+ ### Cómo contribuir
332
+
333
+ 1. **Fork** el proyecto
334
+ 2. **Crea** una rama para tu feature (`git checkout -b feature/AmazingFeature`)
335
+ 3. **Commit** tus cambios (`git commit -m 'Add some AmazingFeature'`)
336
+ 4. **Push** a la rama (`git push origin feature/AmazingFeature`)
337
+ 5. **Abre** un Pull Request
338
+
339
+ ### Guías de contribución
340
+
341
+ - ✅ Sigue las convenciones de código existentes
342
+ - ✅ Añade tests para nuevas funcionalidades
343
+ - ✅ Actualiza la documentación si es necesario
344
+ - ✅ Asegúrate de que todos los tests pasen
345
+ - ✅ Usa `npm run lint` y `npm run format` antes de commitear
346
+
347
+ ### Áreas donde puedes contribuir
348
+
349
+ - 🐛 **Bug fixes** - Reporta y arregla bugs
350
+ - ✨ **Nuevas funcionalidades** - Propón mejoras
351
+ - 📚 **Documentación** - Mejora ejemplos y guías
352
+ - 🧪 **Tests** - Añade casos de prueba
353
+ - 🌍 **Traducciones** - Ayuda con documentación en otros idiomas
354
+ - 🎨 **UI/UX** - Mejora la experiencia del CLI
355
+
356
+ ## 🐛 Reportar bugs
357
+
358
+ Si encuentras un bug, por favor:
359
+
360
+ 1. **Verifica** que no esté ya reportado en [Issues](https://github.com/nicvazquezdev/hispano-lang/issues)
361
+ 2. **Crea** un nuevo issue con:
362
+ - Descripción clara del problema
363
+ - Código que reproduce el error
364
+ - Versión de Node.js
365
+ - Sistema operativo
366
+ - Pasos para reproducir
367
+
368
+ ## 📄 Licencia
369
+
370
+ Este proyecto está bajo la **Licencia MIT**. Ver el archivo [LICENSE](LICENSE) para más detalles.
371
+
372
+ ## 👨‍💻 Autor
373
+
374
+ **Nicolas Vazquez**
375
+
376
+ - 🌐 GitHub: [@nicvazquezdev](https://github.com/nicvazquezdev)
377
+ - 📧 Email: [nicorvazquezs@gmail.com](mailto:nicorvazquezs@gmail.com)
378
+
379
+ ## 🙏 Agradecimientos
380
+
381
+ - 🌍 **Comunidad de desarrolladores hispanohablantes**
382
+ - 🧪 **Contribuidores y testers del proyecto**
383
+ - 📚 **Educadores que usan HispanoLang en sus clases**
384
+ - 🎓 **Estudiantes que aprenden programación con HispanoLang**
385
+
386
+ ## 📊 Estadísticas
387
+
388
+ - 🧪 **170+ tests** cubriendo todas las funcionalidades
389
+ - 📦 **NPM package** listo para instalación global
390
+ - 🔧 **CLI tool** con modo interactivo
391
+ - 📝 **TypeScript support** con definiciones incluidas
392
+ - 🌍 **100% en español** para educación sin barreras
393
+
394
+ ---
395
+
396
+ <div align="center">
397
+
398
+ ⭐ **Si te gusta este proyecto, ¡dale una estrella!**
399
+
400
+ [![GitHub stars](https://img.shields.io/github/stars/nicvazquezdev/hispano-lang?style=social)](https://github.com/nicvazquezdev/hispano-lang)
401
+
402
+ **Hecho con ❤️ para la comunidad hispanohablante**
403
+
404
+ </div>