@designliquido/delegua 0.0.1 → 0.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.
Files changed (43) hide show
  1. package/.github/CONTRIBUTING.md +0 -0
  2. package/.github/workflows/principal.yml +20 -0
  3. package/.release-it.json +8 -0
  4. package/.vscode/launch.json +2 -2
  5. package/README.md +5 -6
  6. package/bin/delegua +1 -1
  7. package/bin/delegua.cmd +1 -0
  8. package/indice.js +14 -0
  9. package/package.json +46 -37
  10. package/src/ambiente.js +53 -0
  11. package/src/{egua.js → delegua.js} +20 -20
  12. package/src/erro.js +18 -0
  13. package/src/estruturas/callable.js +5 -0
  14. package/src/estruturas/classe.js +43 -0
  15. package/src/estruturas/funcao.js +62 -0
  16. package/src/estruturas/funcaoPadrao.js +18 -0
  17. package/src/estruturas/instancia.js +27 -0
  18. package/src/estruturas/modulo.js +9 -0
  19. package/src/expr.js +52 -52
  20. package/src/interpretador.js +802 -0
  21. package/src/lexer.js +90 -89
  22. package/src/lib/globalLib.js +63 -63
  23. package/src/lib/importStdlib.js +18 -27
  24. package/src/parser.js +219 -223
  25. package/src/resolver.js +93 -93
  26. package/src/stmt.js +34 -34
  27. package/src/{tokenTypes.js → tiposDeSimbolos.js} +21 -21
  28. package/src/web.js +41 -41
  29. package/testes/testes.egua +363 -364
  30. package/index.html +0 -43
  31. package/index.js +0 -14
  32. package/src/environment.js +0 -53
  33. package/src/errors.js +0 -17
  34. package/src/interpreter.js +0 -798
  35. package/src/lib/__tests__/eguamat.test.js +0 -101
  36. package/src/lib/eguamat.js +0 -725
  37. package/src/lib/tempo.js +0 -50
  38. package/src/structures/callable.js +0 -5
  39. package/src/structures/class.js +0 -43
  40. package/src/structures/function.js +0 -62
  41. package/src/structures/instance.js +0 -27
  42. package/src/structures/module.js +0 -9
  43. package/src/structures/standardFn.js +0 -18
package/src/expr.js CHANGED
@@ -3,10 +3,10 @@ class Expr {
3
3
  }
4
4
 
5
5
  class Assign extends Expr {
6
- constructor(name, value) {
6
+ constructor(nome, valor) {
7
7
  super();
8
- this.name = name;
9
- this.value = value;
8
+ this.nome = nome;
9
+ this.valor = valor;
10
10
  }
11
11
 
12
12
  aceitar(visitor) {
@@ -15,11 +15,11 @@ class Assign extends Expr {
15
15
  }
16
16
 
17
17
  class Binary extends Expr {
18
- constructor(left, operator, right) {
18
+ constructor(esquerda, operador, direita) {
19
19
  super();
20
- this.left = left;
21
- this.operator = operator;
22
- this.right = right;
20
+ this.esquerda = esquerda;
21
+ this.operador = operador;
22
+ this.direita = direita;
23
23
  }
24
24
 
25
25
  aceitar(visitor) {
@@ -28,10 +28,10 @@ class Binary extends Expr {
28
28
  }
29
29
 
30
30
  class Funcao extends Expr {
31
- constructor(params, body) {
31
+ constructor(parametros, corpo) {
32
32
  super();
33
- this.params = params;
34
- this.body = body;
33
+ this.parametros = parametros;
34
+ this.corpo = corpo;
35
35
  }
36
36
 
37
37
  aceitar(visitor) {
@@ -40,11 +40,11 @@ class Funcao extends Expr {
40
40
  }
41
41
 
42
42
  class Call extends Expr {
43
- constructor(callee, paren, args) {
43
+ constructor(callee, paren, argumentos) {
44
44
  super();
45
45
  this.callee = callee;
46
46
  this.paren = paren;
47
- this.args = args;
47
+ this.argumentos = argumentos;
48
48
  }
49
49
 
50
50
  aceitar(visitor) {
@@ -53,10 +53,10 @@ class Call extends Expr {
53
53
  }
54
54
 
55
55
  class Get extends Expr {
56
- constructor(object, name) {
56
+ constructor(objeto, nome) {
57
57
  super();
58
- this.object = object;
59
- this.name = name;
58
+ this.objeto = objeto;
59
+ this.nome = nome;
60
60
  }
61
61
 
62
62
  aceitar(visitor) {
@@ -65,9 +65,9 @@ class Get extends Expr {
65
65
  }
66
66
 
67
67
  class Grouping extends Expr {
68
- constructor(expression) {
68
+ constructor(expressao) {
69
69
  super();
70
- this.expression = expression;
70
+ this.expressao = expressao;
71
71
  }
72
72
 
73
73
  aceitar(visitor) {
@@ -76,9 +76,9 @@ class Grouping extends Expr {
76
76
  }
77
77
 
78
78
  class Literal extends Expr {
79
- constructor(value) {
79
+ constructor(valor) {
80
80
  super();
81
- this.value = value;
81
+ this.valor = valor;
82
82
  }
83
83
 
84
84
  aceitar(visitor) {
@@ -87,9 +87,9 @@ class Literal extends Expr {
87
87
  }
88
88
 
89
89
  class Array extends Expr {
90
- constructor(values) {
90
+ constructor(valores) {
91
91
  super();
92
- this.values = values;
92
+ this.valores = valores;
93
93
  }
94
94
 
95
95
  aceitar(visitor) {
@@ -97,11 +97,11 @@ class Array extends Expr {
97
97
  }
98
98
  }
99
99
 
100
- class Dictionary extends Expr {
101
- constructor(keys, values) {
100
+ class Dicionario extends Expr {
101
+ constructor(chaves, valores) {
102
102
  super();
103
- this.keys = keys;
104
- this.values = values;
103
+ this.chaves = chaves;
104
+ this.valores = valores;
105
105
  }
106
106
 
107
107
  aceitar(visitor) {
@@ -110,10 +110,10 @@ class Dictionary extends Expr {
110
110
  }
111
111
 
112
112
  class Subscript extends Expr {
113
- constructor(callee, index, closeBracket) {
113
+ constructor(callee, indice, closeBracket) {
114
114
  super();
115
115
  this.callee = callee;
116
- this.index = index;
116
+ this.indice = indice;
117
117
  this.closeBracket = closeBracket;
118
118
  }
119
119
 
@@ -123,11 +123,11 @@ class Subscript extends Expr {
123
123
  }
124
124
 
125
125
  class Assignsubscript extends Expr {
126
- constructor(obj, index, value) {
126
+ constructor(objeto, indice, valor) {
127
127
  super();
128
- this.obj = obj;
129
- this.index = index;
130
- this.value = value;
128
+ this.objeto = objeto;
129
+ this.indice = indice;
130
+ this.valor = valor;
131
131
  }
132
132
 
133
133
  aceitar(visitor) {
@@ -136,11 +136,11 @@ class Assignsubscript extends Expr {
136
136
  }
137
137
 
138
138
  class Logical extends Expr {
139
- constructor(left, operator, right) {
139
+ constructor(esquerda, operador, direita) {
140
140
  super();
141
- this.left = left;
142
- this.operator = operator;
143
- this.right = right;
141
+ this.esquerda = esquerda;
142
+ this.operador = operador;
143
+ this.direita = direita;
144
144
  }
145
145
 
146
146
  aceitar(visitor) {
@@ -149,11 +149,11 @@ class Logical extends Expr {
149
149
  }
150
150
 
151
151
  class Set extends Expr {
152
- constructor(object, name, value) {
152
+ constructor(objeto, nome, valor) {
153
153
  super();
154
- this.object = object;
155
- this.name = name;
156
- this.value = value;
154
+ this.objeto = objeto;
155
+ this.nome = nome;
156
+ this.valor = valor;
157
157
  }
158
158
 
159
159
  aceitar(visitor) {
@@ -162,10 +162,10 @@ class Set extends Expr {
162
162
  }
163
163
 
164
164
  class Super extends Expr {
165
- constructor(keyword, method) {
165
+ constructor(palavraChave, metodo) {
166
166
  super();
167
- this.keyword = keyword;
168
- this.method = method;
167
+ this.palavraChave = palavraChave;
168
+ this.metodo = metodo;
169
169
  }
170
170
 
171
171
  aceitar(visitor) {
@@ -174,9 +174,9 @@ class Super extends Expr {
174
174
  }
175
175
 
176
176
  class Isto extends Expr {
177
- constructor(keyword) {
177
+ constructor(palavraChave) {
178
178
  super();
179
- this.keyword = keyword;
179
+ this.palavraChave = palavraChave;
180
180
  }
181
181
 
182
182
  aceitar(visitor) {
@@ -185,10 +185,10 @@ class Isto extends Expr {
185
185
  }
186
186
 
187
187
  class Unary extends Expr {
188
- constructor(operator, right) {
188
+ constructor(operador, direita) {
189
189
  super();
190
- this.operator = operator;
191
- this.right = right;
190
+ this.operador = operador;
191
+ this.direita = direita;
192
192
  }
193
193
 
194
194
  aceitar(visitor) {
@@ -196,10 +196,10 @@ class Unary extends Expr {
196
196
  }
197
197
  }
198
198
 
199
- class Variable extends Expr {
200
- constructor(name) {
199
+ class Variavel extends Expr {
200
+ constructor(nome) {
201
201
  super();
202
- this.name = name;
202
+ this.nome = nome;
203
203
  }
204
204
 
205
205
  aceitar(visitor) {
@@ -216,7 +216,7 @@ module.exports = {
216
216
  Grouping,
217
217
  Literal,
218
218
  Array,
219
- Dictionary,
219
+ Dicionario,
220
220
  Subscript,
221
221
  Assignsubscript,
222
222
  Logical,
@@ -224,5 +224,5 @@ module.exports = {
224
224
  Super,
225
225
  Isto,
226
226
  Unary,
227
- Variable
227
+ Variavel
228
228
  };