@designliquido/delegua 0.2.1 → 0.2.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 (376) hide show
  1. package/bin/package.json +2 -1
  2. package/{src → fontes}/ambiente.d.ts +4 -3
  3. package/{src → fontes}/ambiente.js +7 -7
  4. package/fontes/ambiente.js.map +1 -0
  5. package/fontes/avaliador-sintatico/dialetos/egua-classico.d.ts +63 -0
  6. package/{src → fontes}/avaliador-sintatico/dialetos/egua-classico.js +230 -217
  7. package/fontes/avaliador-sintatico/dialetos/egua-classico.js.map +1 -0
  8. package/{src → fontes}/avaliador-sintatico/dialetos/index.d.ts +0 -0
  9. package/{src → fontes}/avaliador-sintatico/dialetos/index.js +0 -0
  10. package/fontes/avaliador-sintatico/dialetos/index.js.map +1 -0
  11. package/fontes/avaliador-sintatico/erro-avaliador-sintatico.d.ts +5 -0
  12. package/fontes/avaliador-sintatico/erro-avaliador-sintatico.js +30 -0
  13. package/fontes/avaliador-sintatico/erro-avaliador-sintatico.js.map +1 -0
  14. package/fontes/avaliador-sintatico/index.d.ts +66 -0
  15. package/{src → fontes}/avaliador-sintatico/index.js +231 -216
  16. package/fontes/avaliador-sintatico/index.js.map +1 -0
  17. package/fontes/avaliador-sintatico/retorno-avaliador-sintatico.d.ts +6 -0
  18. package/fontes/avaliador-sintatico/retorno-avaliador-sintatico.js +3 -0
  19. package/fontes/avaliador-sintatico/retorno-avaliador-sintatico.js.map +1 -0
  20. package/{src → fontes}/bibliotecas/biblioteca-global.d.ts +0 -0
  21. package/{src → fontes}/bibliotecas/biblioteca-global.js +4 -4
  22. package/fontes/bibliotecas/biblioteca-global.js.map +1 -0
  23. package/{src → fontes}/bibliotecas/importar-biblioteca.d.ts +0 -0
  24. package/{src → fontes}/bibliotecas/importar-biblioteca.js +0 -0
  25. package/fontes/bibliotecas/importar-biblioteca.js.map +1 -0
  26. package/fontes/construtos/acesso-indice-variavel.d.ts +13 -0
  27. package/fontes/construtos/acesso-indice-variavel.js +21 -0
  28. package/fontes/construtos/acesso-indice-variavel.js.map +1 -0
  29. package/fontes/construtos/acesso-metodo.d.ts +13 -0
  30. package/fontes/construtos/acesso-metodo.js +20 -0
  31. package/fontes/construtos/acesso-metodo.js.map +1 -0
  32. package/fontes/construtos/agrupamento.d.ts +7 -0
  33. package/fontes/construtos/agrupamento.js +15 -0
  34. package/fontes/construtos/agrupamento.js.map +1 -0
  35. package/{src → fontes}/construtos/atribuicao-sobrescrita.d.ts +2 -1
  36. package/{src → fontes}/construtos/atribuicao-sobrescrita.js +2 -1
  37. package/fontes/construtos/atribuicao-sobrescrita.js.map +1 -0
  38. package/fontes/construtos/atribuir.d.ts +9 -0
  39. package/{src → fontes}/construtos/atribuir.js +3 -2
  40. package/fontes/construtos/atribuir.js.map +1 -0
  41. package/{src → fontes}/construtos/binario.d.ts +1 -0
  42. package/{src → fontes}/construtos/binario.js +1 -0
  43. package/fontes/construtos/binario.js.map +1 -0
  44. package/{src → fontes}/construtos/chamada.d.ts +3 -2
  45. package/{src → fontes}/construtos/chamada.js +1 -0
  46. package/fontes/construtos/chamada.js.map +1 -0
  47. package/{src → fontes}/construtos/conjunto.d.ts +2 -1
  48. package/{src → fontes}/construtos/conjunto.js +2 -1
  49. package/fontes/construtos/conjunto.js.map +1 -0
  50. package/{src → fontes}/construtos/construto.d.ts +1 -0
  51. package/{src → fontes}/construtos/construto.js +0 -0
  52. package/fontes/construtos/construto.js.map +1 -0
  53. package/{src → fontes}/construtos/dicionario.d.ts +2 -1
  54. package/{src → fontes}/construtos/dicionario.js +2 -1
  55. package/fontes/construtos/dicionario.js.map +1 -0
  56. package/{src → fontes}/construtos/funcao.d.ts +2 -1
  57. package/{src → fontes}/construtos/funcao.js +2 -1
  58. package/fontes/construtos/funcao.js.map +1 -0
  59. package/{src → fontes}/construtos/index.d.ts +4 -4
  60. package/{src → fontes}/construtos/index.js +4 -4
  61. package/fontes/construtos/index.js.map +1 -0
  62. package/{src → fontes}/construtos/isto.d.ts +2 -1
  63. package/{src → fontes}/construtos/isto.js +2 -1
  64. package/fontes/construtos/isto.js.map +1 -0
  65. package/{src → fontes}/construtos/literal.d.ts +2 -1
  66. package/{src → fontes}/construtos/literal.js +2 -1
  67. package/fontes/construtos/literal.js.map +1 -0
  68. package/{src/construtos/logical.d.ts → fontes/construtos/logico.d.ts} +2 -1
  69. package/fontes/construtos/logico.js +17 -0
  70. package/fontes/construtos/logico.js.map +1 -0
  71. package/{src → fontes}/construtos/super.d.ts +2 -1
  72. package/{src → fontes}/construtos/super.js +2 -1
  73. package/fontes/construtos/super.js.map +1 -0
  74. package/{src → fontes}/construtos/unario.d.ts +1 -0
  75. package/{src → fontes}/construtos/unario.js +1 -0
  76. package/fontes/construtos/unario.js.map +1 -0
  77. package/fontes/construtos/variavel.d.ts +8 -0
  78. package/{src → fontes}/construtos/variavel.js +3 -2
  79. package/fontes/construtos/variavel.js.map +1 -0
  80. package/{src → fontes}/construtos/vetor.d.ts +2 -1
  81. package/{src → fontes}/construtos/vetor.js +2 -1
  82. package/fontes/construtos/vetor.js.map +1 -0
  83. package/{src → fontes}/declaracoes/bloco.d.ts +0 -0
  84. package/{src → fontes}/declaracoes/bloco.js +1 -1
  85. package/fontes/declaracoes/bloco.js.map +1 -0
  86. package/{src → fontes}/declaracoes/classe.d.ts +3 -2
  87. package/{src → fontes}/declaracoes/classe.js +3 -3
  88. package/fontes/declaracoes/classe.js.map +1 -0
  89. package/{src → fontes}/declaracoes/continua.d.ts +0 -0
  90. package/{src → fontes}/declaracoes/continua.js +1 -1
  91. package/fontes/declaracoes/continua.js.map +1 -0
  92. package/{src → fontes}/declaracoes/declaracao.d.ts +2 -0
  93. package/{src → fontes}/declaracoes/declaracao.js +2 -1
  94. package/fontes/declaracoes/declaracao.js.map +1 -0
  95. package/{src → fontes}/declaracoes/enquanto.d.ts +0 -0
  96. package/{src → fontes}/declaracoes/enquanto.js +1 -1
  97. package/fontes/declaracoes/enquanto.js.map +1 -0
  98. package/{src → fontes}/declaracoes/escolha.d.ts +3 -3
  99. package/{src → fontes}/declaracoes/escolha.js +4 -4
  100. package/fontes/declaracoes/escolha.js.map +1 -0
  101. package/{src → fontes}/declaracoes/escreva.d.ts +0 -0
  102. package/{src → fontes}/declaracoes/escreva.js +1 -1
  103. package/fontes/declaracoes/escreva.js.map +1 -0
  104. package/{src → fontes}/declaracoes/expressao.d.ts +3 -2
  105. package/{src → fontes}/declaracoes/expressao.js +1 -1
  106. package/fontes/declaracoes/expressao.js.map +1 -0
  107. package/{src → fontes}/declaracoes/fazer.d.ts +3 -3
  108. package/{src → fontes}/declaracoes/fazer.js +4 -4
  109. package/fontes/declaracoes/fazer.js.map +1 -0
  110. package/fontes/declaracoes/funcao.d.ts +8 -0
  111. package/{src → fontes}/declaracoes/funcao.js +3 -3
  112. package/fontes/declaracoes/funcao.js.map +1 -0
  113. package/fontes/declaracoes/importar.d.ts +8 -0
  114. package/{src → fontes}/declaracoes/importar.js +3 -3
  115. package/fontes/declaracoes/importar.js.map +1 -0
  116. package/{src → fontes}/declaracoes/index.d.ts +1 -1
  117. package/{src → fontes}/declaracoes/index.js +1 -1
  118. package/fontes/declaracoes/index.js.map +1 -0
  119. package/{src → fontes}/declaracoes/para.d.ts +1 -1
  120. package/{src → fontes}/declaracoes/para.js +2 -2
  121. package/fontes/declaracoes/para.js.map +1 -0
  122. package/{src → fontes}/declaracoes/retorna.d.ts +0 -0
  123. package/{src → fontes}/declaracoes/retorna.js +1 -1
  124. package/fontes/declaracoes/retorna.js.map +1 -0
  125. package/fontes/declaracoes/se.d.ts +9 -0
  126. package/{src → fontes}/declaracoes/se.js +5 -5
  127. package/fontes/declaracoes/se.js.map +1 -0
  128. package/{src/declaracoes/pausa.d.ts → fontes/declaracoes/sustar.d.ts} +1 -1
  129. package/{src/declaracoes/pausa.js → fontes/declaracoes/sustar.js} +10 -10
  130. package/fontes/declaracoes/sustar.js.map +1 -0
  131. package/fontes/declaracoes/tente.d.ts +9 -0
  132. package/{src → fontes}/declaracoes/tente.js +6 -6
  133. package/fontes/declaracoes/tente.js.map +1 -0
  134. package/fontes/declaracoes/var.d.ts +8 -0
  135. package/{src → fontes}/declaracoes/var.js +3 -3
  136. package/fontes/declaracoes/var.js.map +1 -0
  137. package/{src → fontes}/delegua.d.ts +6 -7
  138. package/fontes/delegua.js +174 -0
  139. package/fontes/delegua.js.map +1 -0
  140. package/{src → fontes}/estruturas/chamavel.d.ts +0 -0
  141. package/{src → fontes}/estruturas/chamavel.js +0 -0
  142. package/fontes/estruturas/chamavel.js.map +1 -0
  143. package/{src → fontes}/estruturas/classe.d.ts +0 -0
  144. package/{src → fontes}/estruturas/classe.js +0 -0
  145. package/fontes/estruturas/classe.js.map +1 -0
  146. package/{src → fontes}/estruturas/funcao-padrao.d.ts +0 -0
  147. package/{src → fontes}/estruturas/funcao-padrao.js +0 -0
  148. package/fontes/estruturas/funcao-padrao.js.map +1 -0
  149. package/{src → fontes}/estruturas/funcao.d.ts +0 -0
  150. package/{src → fontes}/estruturas/funcao.js +0 -0
  151. package/fontes/estruturas/funcao.js.map +1 -0
  152. package/{src → fontes}/estruturas/index.d.ts +0 -0
  153. package/{src → fontes}/estruturas/index.js +0 -0
  154. package/fontes/estruturas/index.js.map +1 -0
  155. package/fontes/estruturas/instancia.d.ts +9 -0
  156. package/{src → fontes}/estruturas/instancia.js +7 -7
  157. package/fontes/estruturas/instancia.js.map +1 -0
  158. package/{src → fontes}/estruturas/modulo.d.ts +4 -0
  159. package/{src → fontes}/estruturas/modulo.js +3 -3
  160. package/fontes/estruturas/modulo.js.map +1 -0
  161. package/fontes/excecoes/erro-em-tempo-de-execucao.d.ts +7 -0
  162. package/{src → fontes}/excecoes/erro-em-tempo-de-execucao.js +2 -1
  163. package/fontes/excecoes/erro-em-tempo-de-execucao.js.map +1 -0
  164. package/{src → fontes}/excecoes/excecao-continuar.d.ts +0 -0
  165. package/{src → fontes}/excecoes/excecao-continuar.js +0 -0
  166. package/fontes/excecoes/excecao-continuar.js.map +1 -0
  167. package/{src → fontes}/excecoes/excecao-retornar.d.ts +0 -0
  168. package/{src → fontes}/excecoes/excecao-retornar.js +0 -0
  169. package/fontes/excecoes/excecao-retornar.js.map +1 -0
  170. package/fontes/excecoes/excecao-sustar.d.ts +2 -0
  171. package/{src/excecoes/excecao-quebra.js → fontes/excecoes/excecao-sustar.js} +7 -7
  172. package/fontes/excecoes/excecao-sustar.js.map +1 -0
  173. package/{src → fontes}/excecoes/index.d.ts +1 -1
  174. package/{src → fontes}/excecoes/index.js +1 -1
  175. package/fontes/excecoes/index.js.map +1 -0
  176. package/fontes/interfaces/avaliador-sintatico-interface.d.ts +59 -0
  177. package/{src → fontes}/interfaces/avaliador-sintatico-interface.js +0 -0
  178. package/fontes/interfaces/avaliador-sintatico-interface.js.map +1 -0
  179. package/{src → fontes}/interfaces/index.d.ts +0 -0
  180. package/{src → fontes}/interfaces/index.js +0 -0
  181. package/fontes/interfaces/index.js.map +1 -0
  182. package/fontes/interfaces/interpretador-interface.d.ts +53 -0
  183. package/{src → fontes}/interfaces/interpretador-interface.js +0 -0
  184. package/fontes/interfaces/interpretador-interface.js.map +1 -0
  185. package/fontes/interfaces/lexador-interface.d.ts +24 -0
  186. package/{src → fontes}/interfaces/lexador-interface.js +0 -0
  187. package/fontes/interfaces/lexador-interface.js.map +1 -0
  188. package/{src → fontes}/interfaces/pilha-interface.d.ts +0 -0
  189. package/{src → fontes}/interfaces/pilha-interface.js +0 -0
  190. package/fontes/interfaces/pilha-interface.js.map +1 -0
  191. package/fontes/interfaces/resolvedor-interface.d.ts +53 -0
  192. package/{src → fontes}/interfaces/resolvedor-interface.js +0 -0
  193. package/fontes/interfaces/resolvedor-interface.js.map +1 -0
  194. package/{src → fontes}/interfaces/simbolo-interface.d.ts +0 -0
  195. package/{src → fontes}/interfaces/simbolo-interface.js +0 -0
  196. package/fontes/interfaces/simbolo-interface.js.map +1 -0
  197. package/fontes/interpretador/dialetos/egua-classico.d.ts +62 -0
  198. package/{src → fontes}/interpretador/dialetos/egua-classico.js +211 -185
  199. package/fontes/interpretador/dialetos/egua-classico.js.map +1 -0
  200. package/{src → fontes}/interpretador/dialetos/index.d.ts +0 -0
  201. package/{src → fontes}/interpretador/dialetos/index.js +0 -0
  202. package/fontes/interpretador/dialetos/index.js.map +1 -0
  203. package/fontes/interpretador/index.d.ts +63 -0
  204. package/{src → fontes}/interpretador/index.js +245 -226
  205. package/fontes/interpretador/index.js.map +1 -0
  206. package/{src → fontes}/lexador/dialetos/egua-classico.d.ts +11 -9
  207. package/{src → fontes}/lexador/dialetos/egua-classico.js +103 -54
  208. package/fontes/lexador/dialetos/egua-classico.js.map +1 -0
  209. package/{src → fontes}/lexador/dialetos/index.d.ts +0 -0
  210. package/{src → fontes}/lexador/dialetos/index.js +0 -0
  211. package/fontes/lexador/dialetos/index.js.map +1 -0
  212. package/fontes/lexador/erro-lexador.d.ts +5 -0
  213. package/fontes/lexador/erro-lexador.js +3 -0
  214. package/fontes/lexador/erro-lexador.js.map +1 -0
  215. package/{src → fontes}/lexador/index.d.ts +5 -4
  216. package/{src → fontes}/lexador/index.js +21 -9
  217. package/fontes/lexador/index.js.map +1 -0
  218. package/fontes/lexador/retorno-lexador.d.ts +6 -0
  219. package/fontes/lexador/retorno-lexador.js +3 -0
  220. package/fontes/lexador/retorno-lexador.js.map +1 -0
  221. package/fontes/resolvedor/dialetos/egua-classico.d.ts +62 -0
  222. package/fontes/resolvedor/dialetos/egua-classico.js +343 -0
  223. package/fontes/resolvedor/dialetos/egua-classico.js.map +1 -0
  224. package/{src → fontes}/resolvedor/dialetos/index.d.ts +0 -0
  225. package/{src → fontes}/resolvedor/dialetos/index.js +0 -0
  226. package/fontes/resolvedor/dialetos/index.js.map +1 -0
  227. package/fontes/resolvedor/erro-resolvedor.d.ts +5 -0
  228. package/{src → fontes}/resolvedor/erro-resolvedor.js +3 -2
  229. package/fontes/resolvedor/erro-resolvedor.js.map +1 -0
  230. package/fontes/resolvedor/index.d.ts +62 -0
  231. package/fontes/resolvedor/index.js +342 -0
  232. package/fontes/resolvedor/index.js.map +1 -0
  233. package/{src → fontes}/resolvedor/pilha-escopos.d.ts +0 -0
  234. package/{src → fontes}/resolvedor/pilha-escopos.js +0 -0
  235. package/fontes/resolvedor/pilha-escopos.js.map +1 -0
  236. package/fontes/resolvedor/retorno-resolvedor.d.ts +4 -0
  237. package/fontes/resolvedor/retorno-resolvedor.js +3 -0
  238. package/fontes/resolvedor/retorno-resolvedor.js.map +1 -0
  239. package/{src → fontes}/tiposDeSimbolos.d.ts +0 -0
  240. package/{src → fontes}/tiposDeSimbolos.js +0 -0
  241. package/fontes/tiposDeSimbolos.js.map +1 -0
  242. package/index.js +1 -1
  243. package/index.js.map +1 -1
  244. package/package.json +2 -1
  245. package/testes/avaliador-sintatico.test.js +14 -14
  246. package/testes/avaliador-sintatico.test.js.map +1 -1
  247. package/testes/biblioteca-global.test.d.ts +1 -0
  248. package/testes/biblioteca-global.test.js +131 -0
  249. package/testes/biblioteca-global.test.js.map +1 -0
  250. package/testes/egua-classico/avaliador-sintatico.test.d.ts +1 -0
  251. package/testes/egua-classico/avaliador-sintatico.test.js +33 -0
  252. package/testes/egua-classico/avaliador-sintatico.test.js.map +1 -0
  253. package/testes/egua-classico/interpretador.test.d.ts +1 -0
  254. package/testes/egua-classico/interpretador.test.js +219 -0
  255. package/testes/egua-classico/interpretador.test.js.map +1 -0
  256. package/testes/egua-classico/lexador.test.d.ts +1 -0
  257. package/testes/egua-classico/lexador.test.js +80 -0
  258. package/testes/egua-classico/lexador.test.js.map +1 -0
  259. package/testes/egua-classico/resolvedor.test.d.ts +1 -0
  260. package/testes/egua-classico/resolvedor.test.js +38 -0
  261. package/testes/egua-classico/resolvedor.test.js.map +1 -0
  262. package/testes/interpretador.test.js +154 -75
  263. package/testes/interpretador.test.js.map +1 -1
  264. package/testes/lexador.test.js +17 -14
  265. package/testes/lexador.test.js.map +1 -1
  266. package/testes/resolvedor.test.js +4 -4
  267. package/testes/resolvedor.test.js.map +1 -1
  268. package/src/ambiente.js.map +0 -1
  269. package/src/avaliador-sintatico/dialetos/egua-classico.d.ts +0 -60
  270. package/src/avaliador-sintatico/dialetos/egua-classico.js.map +0 -1
  271. package/src/avaliador-sintatico/dialetos/index.js.map +0 -1
  272. package/src/avaliador-sintatico/erros-avaliador.d.ts +0 -2
  273. package/src/avaliador-sintatico/erros-avaliador.js +0 -27
  274. package/src/avaliador-sintatico/erros-avaliador.js.map +0 -1
  275. package/src/avaliador-sintatico/index.d.ts +0 -62
  276. package/src/avaliador-sintatico/index.js.map +0 -1
  277. package/src/bibliotecas/biblioteca-global.js.map +0 -1
  278. package/src/bibliotecas/importar-biblioteca.js.map +0 -1
  279. package/src/construtos/atribuicao-sobrescrita.js.map +0 -1
  280. package/src/construtos/atribuir.d.ts +0 -7
  281. package/src/construtos/atribuir.js.map +0 -1
  282. package/src/construtos/binario.js.map +0 -1
  283. package/src/construtos/chamada.js.map +0 -1
  284. package/src/construtos/conjunto.js.map +0 -1
  285. package/src/construtos/construto.js.map +0 -1
  286. package/src/construtos/dicionario.js.map +0 -1
  287. package/src/construtos/funcao.js.map +0 -1
  288. package/src/construtos/get.d.ts +0 -7
  289. package/src/construtos/get.js +0 -15
  290. package/src/construtos/get.js.map +0 -1
  291. package/src/construtos/grouping.d.ts +0 -6
  292. package/src/construtos/grouping.js +0 -14
  293. package/src/construtos/grouping.js.map +0 -1
  294. package/src/construtos/index.js.map +0 -1
  295. package/src/construtos/isto.js.map +0 -1
  296. package/src/construtos/literal.js.map +0 -1
  297. package/src/construtos/logical.js +0 -16
  298. package/src/construtos/logical.js.map +0 -1
  299. package/src/construtos/subscript.d.ts +0 -8
  300. package/src/construtos/subscript.js +0 -16
  301. package/src/construtos/subscript.js.map +0 -1
  302. package/src/construtos/super.js.map +0 -1
  303. package/src/construtos/unario.js.map +0 -1
  304. package/src/construtos/variavel.d.ts +0 -6
  305. package/src/construtos/variavel.js.map +0 -1
  306. package/src/construtos/vetor.js.map +0 -1
  307. package/src/declaracoes/bloco.js.map +0 -1
  308. package/src/declaracoes/classe.js.map +0 -1
  309. package/src/declaracoes/continua.js.map +0 -1
  310. package/src/declaracoes/declaracao.js.map +0 -1
  311. package/src/declaracoes/enquanto.js.map +0 -1
  312. package/src/declaracoes/escolha.js.map +0 -1
  313. package/src/declaracoes/escreva.js.map +0 -1
  314. package/src/declaracoes/expressao.js.map +0 -1
  315. package/src/declaracoes/fazer.js.map +0 -1
  316. package/src/declaracoes/funcao.d.ts +0 -7
  317. package/src/declaracoes/funcao.js.map +0 -1
  318. package/src/declaracoes/importar.d.ts +0 -7
  319. package/src/declaracoes/importar.js.map +0 -1
  320. package/src/declaracoes/index.js.map +0 -1
  321. package/src/declaracoes/para.js.map +0 -1
  322. package/src/declaracoes/pausa.js.map +0 -1
  323. package/src/declaracoes/retorna.js.map +0 -1
  324. package/src/declaracoes/se.d.ts +0 -9
  325. package/src/declaracoes/se.js.map +0 -1
  326. package/src/declaracoes/tente.d.ts +0 -9
  327. package/src/declaracoes/tente.js.map +0 -1
  328. package/src/declaracoes/var.d.ts +0 -7
  329. package/src/declaracoes/var.js.map +0 -1
  330. package/src/delegua.js +0 -138
  331. package/src/delegua.js.map +0 -1
  332. package/src/estruturas/chamavel.js.map +0 -1
  333. package/src/estruturas/classe.js.map +0 -1
  334. package/src/estruturas/funcao-padrao.js.map +0 -1
  335. package/src/estruturas/funcao.js.map +0 -1
  336. package/src/estruturas/index.js.map +0 -1
  337. package/src/estruturas/instancia.d.ts +0 -8
  338. package/src/estruturas/instancia.js.map +0 -1
  339. package/src/estruturas/modulo.js.map +0 -1
  340. package/src/excecoes/erro-em-tempo-de-execucao.d.ts +0 -5
  341. package/src/excecoes/erro-em-tempo-de-execucao.js.map +0 -1
  342. package/src/excecoes/excecao-continuar.js.map +0 -1
  343. package/src/excecoes/excecao-quebra.d.ts +0 -2
  344. package/src/excecoes/excecao-quebra.js.map +0 -1
  345. package/src/excecoes/excecao-retornar.js.map +0 -1
  346. package/src/excecoes/index.js.map +0 -1
  347. package/src/interfaces/avaliador-sintatico-interface.d.ts +0 -55
  348. package/src/interfaces/avaliador-sintatico-interface.js.map +0 -1
  349. package/src/interfaces/index.js.map +0 -1
  350. package/src/interfaces/interpretador-interface.d.ts +0 -51
  351. package/src/interfaces/interpretador-interface.js.map +0 -1
  352. package/src/interfaces/lexador-interface.d.ts +0 -23
  353. package/src/interfaces/lexador-interface.js.map +0 -1
  354. package/src/interfaces/pilha-interface.js.map +0 -1
  355. package/src/interfaces/resolvedor-interface.d.ts +0 -50
  356. package/src/interfaces/resolvedor-interface.js.map +0 -1
  357. package/src/interfaces/simbolo-interface.js.map +0 -1
  358. package/src/interpretador/dialetos/egua-classico.d.ts +0 -58
  359. package/src/interpretador/dialetos/egua-classico.js.map +0 -1
  360. package/src/interpretador/dialetos/index.js.map +0 -1
  361. package/src/interpretador/index.d.ts +0 -59
  362. package/src/interpretador/index.js.map +0 -1
  363. package/src/lexador/dialetos/egua-classico.js.map +0 -1
  364. package/src/lexador/dialetos/index.js.map +0 -1
  365. package/src/lexador/index.js.map +0 -1
  366. package/src/resolvedor/dialetos/egua-classico.d.ts +0 -59
  367. package/src/resolvedor/dialetos/egua-classico.js +0 -331
  368. package/src/resolvedor/dialetos/egua-classico.js.map +0 -1
  369. package/src/resolvedor/dialetos/index.js.map +0 -1
  370. package/src/resolvedor/erro-resolvedor.d.ts +0 -4
  371. package/src/resolvedor/erro-resolvedor.js.map +0 -1
  372. package/src/resolvedor/index.d.ts +0 -60
  373. package/src/resolvedor/index.js +0 -331
  374. package/src/resolvedor/index.js.map +0 -1
  375. package/src/resolvedor/pilha-escopos.js.map +0 -1
  376. package/src/tiposDeSimbolos.js.map +0 -1
@@ -1,13 +1,39 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
2
28
  Object.defineProperty(exports, "__esModule", { value: true });
3
29
  exports.InterpretadorEguaClassico = void 0;
4
- var tiposDeSimbolos_1 = require("../../tiposDeSimbolos");
30
+ var tiposDeSimbolos_1 = __importDefault(require("../../tiposDeSimbolos"));
5
31
  var ambiente_1 = require("../../ambiente");
6
32
  var delegua_1 = require("../../delegua");
7
- var biblioteca_global_1 = require("../../bibliotecas/biblioteca-global");
8
- var caminho = require("path");
9
- var fs = require("fs");
10
- var importar_biblioteca_1 = require("../../bibliotecas/importar-biblioteca");
33
+ var biblioteca_global_1 = __importDefault(require("../../bibliotecas/biblioteca-global"));
34
+ var caminho = __importStar(require("path"));
35
+ var fs = __importStar(require("fs"));
36
+ var importar_biblioteca_1 = __importDefault(require("../../bibliotecas/importar-biblioteca"));
11
37
  var chamavel_1 = require("../../estruturas/chamavel");
12
38
  var funcao_padrao_1 = require("../../estruturas/funcao-padrao");
13
39
  var classe_1 = require("../../estruturas/classe");
@@ -28,31 +54,31 @@ var InterpretadorEguaClassico = /** @class */ (function () {
28
54
  this.locais = new Map();
29
55
  this.global = (0, biblioteca_global_1.default)(this, this.global);
30
56
  }
31
- InterpretadorEguaClassico.prototype.resolver = function (expr, depth) {
32
- this.locais.set(expr, depth);
57
+ InterpretadorEguaClassico.prototype.resolver = function (expressao, profundidade) {
58
+ this.locais.set(expressao, profundidade);
33
59
  };
34
- InterpretadorEguaClassico.prototype.visitarExpressaoLiteral = function (expr) {
35
- return expr.valor;
60
+ InterpretadorEguaClassico.prototype.visitarExpressaoLiteral = function (expressao) {
61
+ return expressao.valor;
36
62
  };
37
- InterpretadorEguaClassico.prototype.avaliar = function (expr) {
38
- if (expr.aceitar) {
39
- return expr.aceitar(this);
63
+ InterpretadorEguaClassico.prototype.avaliar = function (expressao) {
64
+ if (expressao.aceitar) {
65
+ return expressao.aceitar(this);
40
66
  }
41
67
  };
42
- InterpretadorEguaClassico.prototype.visitarExpressaoAgrupamento = function (expr) {
43
- return this.avaliar(expr.expressao);
68
+ InterpretadorEguaClassico.prototype.visitarExpressaoAgrupamento = function (expressao) {
69
+ return this.avaliar(expressao.expressao);
44
70
  };
45
71
  InterpretadorEguaClassico.prototype.eVerdadeiro = function (objeto) {
46
72
  if (objeto === null)
47
73
  return false;
48
- if (typeof objeto === "boolean")
74
+ if (typeof objeto === 'boolean')
49
75
  return Boolean(objeto);
50
76
  return true;
51
77
  };
52
78
  InterpretadorEguaClassico.prototype.verificarOperandoNumero = function (operador, operand) {
53
- if (typeof operand === "number")
79
+ if (typeof operand === 'number')
54
80
  return;
55
- throw new excecoes_1.ErroEmTempoDeExecucao(operador, "Operador precisa ser um número.");
81
+ throw new excecoes_1.ErroEmTempoDeExecucao(operador, 'Operador precisa ser um número.', operador.linha);
56
82
  };
57
83
  InterpretadorEguaClassico.prototype.visitarExpressaoUnaria = function (expr) {
58
84
  var direita = this.avaliar(expr.direita);
@@ -75,9 +101,9 @@ var InterpretadorEguaClassico = /** @class */ (function () {
75
101
  return esquerda === direita;
76
102
  };
77
103
  InterpretadorEguaClassico.prototype.verificarOperandosNumeros = function (operador, direita, esquerda) {
78
- if (typeof direita === "number" && typeof esquerda === "number")
104
+ if (typeof direita === 'number' && typeof esquerda === 'number')
79
105
  return;
80
- throw new excecoes_1.ErroEmTempoDeExecucao(operador, "Operadores precisam ser números.");
106
+ throw new excecoes_1.ErroEmTempoDeExecucao(operador, 'Operadores precisam ser números.', operador.linha);
81
107
  };
82
108
  InterpretadorEguaClassico.prototype.visitarExpressaoBinaria = function (expr) {
83
109
  var esquerda = this.avaliar(expr.esquerda);
@@ -102,14 +128,15 @@ var InterpretadorEguaClassico = /** @class */ (function () {
102
128
  this.verificarOperandosNumeros(expr.operador, esquerda, direita);
103
129
  return Number(esquerda) - Number(direita);
104
130
  case tiposDeSimbolos_1.default.ADICAO:
105
- if (typeof esquerda === "number" && typeof direita === "number") {
131
+ if (typeof esquerda === 'number' &&
132
+ typeof direita === 'number') {
106
133
  return Number(esquerda) + Number(direita);
107
134
  }
108
- else if (typeof esquerda === "string" &&
109
- typeof direita === "string") {
135
+ else if (typeof esquerda === 'string' &&
136
+ typeof direita === 'string') {
110
137
  return String(esquerda) + String(direita);
111
138
  }
112
- throw new excecoes_1.ErroEmTempoDeExecucao(expr.operador, "Operadores precisam ser dois números ou duas strings.");
139
+ throw new excecoes_1.ErroEmTempoDeExecucao(expr.operador, 'Operadores precisam ser dois números ou duas strings.');
113
140
  case tiposDeSimbolos_1.default.DIVISAO:
114
141
  this.verificarOperandosNumeros(expr.operador, esquerda, direita);
115
142
  return Number(esquerda) / Number(direita);
@@ -141,14 +168,14 @@ var InterpretadorEguaClassico = /** @class */ (function () {
141
168
  }
142
169
  return null;
143
170
  };
144
- InterpretadorEguaClassico.prototype.visitarExpressaoDeChamada = function (expr) {
145
- var entidadeChamada = this.avaliar(expr.entidadeChamada);
171
+ InterpretadorEguaClassico.prototype.visitarExpressaoDeChamada = function (expressao) {
172
+ var entidadeChamada = this.avaliar(expressao.entidadeChamada);
146
173
  var argumentos = [];
147
- for (var i = 0; i < expr.argumentos.length; i++) {
148
- argumentos.push(this.avaliar(expr.argumentos[i]));
174
+ for (var i = 0; i < expressao.argumentos.length; i++) {
175
+ argumentos.push(this.avaliar(expressao.argumentos[i]));
149
176
  }
150
177
  if (!(entidadeChamada instanceof chamavel_1.Chamavel)) {
151
- throw new excecoes_1.ErroEmTempoDeExecucao(expr.parentese, "Só pode chamar função ou classe.");
178
+ throw new excecoes_1.ErroEmTempoDeExecucao(expressao.parentese, 'Só pode chamar função ou classe.', expressao.linha);
152
179
  }
153
180
  var parametros;
154
181
  if (entidadeChamada instanceof funcao_1.DeleguaFuncao) {
@@ -172,101 +199,101 @@ var InterpretadorEguaClassico = /** @class */ (function () {
172
199
  else {
173
200
  if (parametros &&
174
201
  parametros.length > 0 &&
175
- parametros[parametros.length - 1]["tipo"] === "wildcard") {
202
+ parametros[parametros.length - 1]['tipo'] === 'wildcard') {
176
203
  var novosArgumentos = argumentos.slice(0, parametros.length - 1);
177
204
  novosArgumentos.push(argumentos.slice(parametros.length - 1, argumentos.length));
178
205
  argumentos = novosArgumentos;
179
206
  }
180
207
  }
181
208
  if (entidadeChamada instanceof funcao_padrao_1.FuncaoPadrao) {
182
- return entidadeChamada.chamar(this, argumentos, expr.entidadeChamada.nome);
209
+ return entidadeChamada.chamar(this, argumentos, expressao.entidadeChamada.nome);
183
210
  }
184
211
  return entidadeChamada.chamar(this, argumentos);
185
212
  };
186
- InterpretadorEguaClassico.prototype.visitarExpressaoDeAtribuicao = function (expr) {
187
- var valor = this.avaliar(expr.valor);
188
- var distancia = this.locais.get(expr);
213
+ InterpretadorEguaClassico.prototype.visitarExpressaoDeAtribuicao = function (expressao) {
214
+ var valor = this.avaliar(expressao.valor);
215
+ var distancia = this.locais.get(expressao);
189
216
  if (distancia !== undefined) {
190
- this.ambiente.atribuirVariavelEm(distancia, expr.nome, valor);
217
+ this.ambiente.atribuirVariavelEm(distancia, expressao.simbolo, valor);
191
218
  }
192
219
  else {
193
- this.ambiente.atribuirVariavel(expr.nome, valor);
220
+ this.ambiente.atribuirVariavel(expressao.simbolo, valor);
194
221
  }
195
222
  return valor;
196
223
  };
197
- InterpretadorEguaClassico.prototype.procurarVariavel = function (nome, expr) {
224
+ InterpretadorEguaClassico.prototype.procurarVariavel = function (simbolo, expr) {
198
225
  var distancia = this.locais.get(expr);
199
226
  if (distancia !== undefined) {
200
- return this.ambiente.obterVariavelEm(distancia, nome.lexema);
227
+ return this.ambiente.obterVariavelEm(distancia, simbolo.lexema);
201
228
  }
202
229
  else {
203
- return this.global.obterVariavel(nome);
230
+ return this.global.obterVariavel(simbolo);
204
231
  }
205
232
  };
206
- InterpretadorEguaClassico.prototype.visitarExpressaoDeVariavel = function (expr) {
207
- return this.procurarVariavel(expr.nome, expr);
233
+ InterpretadorEguaClassico.prototype.visitarExpressaoDeVariavel = function (expressao) {
234
+ return this.procurarVariavel(expressao.simbolo, expressao);
208
235
  };
209
- InterpretadorEguaClassico.prototype.visitarDeclaracaoDeExpressao = function (stmt) {
210
- return this.avaliar(stmt.expressao);
236
+ InterpretadorEguaClassico.prototype.visitarDeclaracaoDeExpressao = function (declaracao) {
237
+ return this.avaliar(declaracao.expressao);
211
238
  };
212
- InterpretadorEguaClassico.prototype.visitarExpressaoLogica = function (expr) {
213
- var esquerda = this.avaliar(expr.esquerda);
214
- if (expr.operador.tipo === tiposDeSimbolos_1.default.EM) {
215
- var direita = this.avaliar(expr.direita);
216
- if (Array.isArray(direita) || typeof direita === "string") {
239
+ InterpretadorEguaClassico.prototype.visitarExpressaoLogica = function (expressao) {
240
+ var esquerda = this.avaliar(expressao.esquerda);
241
+ if (expressao.operador.tipo === tiposDeSimbolos_1.default.EM) {
242
+ var direita = this.avaliar(expressao.direita);
243
+ if (Array.isArray(direita) || typeof direita === 'string') {
217
244
  return direita.includes(esquerda);
218
245
  }
219
246
  else if (direita.constructor === Object) {
220
247
  return esquerda in direita;
221
248
  }
222
249
  else {
223
- throw new excecoes_1.ErroEmTempoDeExecucao("Tipo de chamada inválida com 'em'.");
250
+ throw new excecoes_1.ErroEmTempoDeExecucao(esquerda, "Tipo de chamada inválida com 'em'.", expressao.linha);
224
251
  }
225
252
  }
226
253
  // se um estado for verdadeiro, retorna verdadeiro
227
- if (expr.operador.tipo === tiposDeSimbolos_1.default.OU) {
254
+ if (expressao.operador.tipo === tiposDeSimbolos_1.default.OU) {
228
255
  if (this.eVerdadeiro(esquerda))
229
256
  return esquerda;
230
257
  }
231
258
  // se um estado for falso, retorna falso
232
- if (expr.operador.tipo === tiposDeSimbolos_1.default.E) {
259
+ if (expressao.operador.tipo === tiposDeSimbolos_1.default.E) {
233
260
  if (!this.eVerdadeiro(esquerda))
234
261
  return esquerda;
235
262
  }
236
- return this.avaliar(expr.direita);
263
+ return this.avaliar(expressao.direita);
237
264
  };
238
- InterpretadorEguaClassico.prototype.visitarExpressaoSe = function (stmt) {
239
- if (this.eVerdadeiro(this.avaliar(stmt.condicao))) {
240
- this.executar(stmt.thenBranch);
265
+ InterpretadorEguaClassico.prototype.visitarExpressaoSe = function (declaracao) {
266
+ if (this.eVerdadeiro(this.avaliar(declaracao.condicao))) {
267
+ this.executar(declaracao.caminhoEntao);
241
268
  return null;
242
269
  }
243
- for (var i = 0; i < stmt.elifBranches.length; i++) {
244
- var atual = stmt.elifBranches[i];
270
+ for (var i = 0; i < declaracao.caminhosSeSenao.length; i++) {
271
+ var atual = declaracao.caminhosSeSenao[i];
245
272
  if (this.eVerdadeiro(this.avaliar(atual.condicao))) {
246
- this.executar(atual.branch);
273
+ this.executar(atual.caminho);
247
274
  return null;
248
275
  }
249
276
  }
250
- if (stmt.elseBranch !== null) {
251
- this.executar(stmt.elseBranch);
277
+ if (declaracao.caminhoSenao !== null) {
278
+ this.executar(declaracao.caminhoSenao);
252
279
  }
253
280
  return null;
254
281
  };
255
- InterpretadorEguaClassico.prototype.visitarExpressaoPara = function (stmt) {
256
- if (stmt.inicializador !== null) {
257
- this.avaliar(stmt.inicializador);
282
+ InterpretadorEguaClassico.prototype.visitarExpressaoPara = function (declaracao) {
283
+ if (declaracao.inicializador !== null) {
284
+ this.avaliar(declaracao.inicializador);
258
285
  }
259
286
  while (true) {
260
- if (stmt.condicao !== null) {
261
- if (!this.eVerdadeiro(this.avaliar(stmt.condicao))) {
287
+ if (declaracao.condicao !== null) {
288
+ if (!this.eVerdadeiro(this.avaliar(declaracao.condicao))) {
262
289
  break;
263
290
  }
264
291
  }
265
292
  try {
266
- this.executar(stmt.corpo);
293
+ this.executar(declaracao.corpo);
267
294
  }
268
295
  catch (erro) {
269
- if (erro instanceof excecoes_1.ExcecaoQuebra) {
296
+ if (erro instanceof excecoes_1.ExcecaoSustar) {
270
297
  break;
271
298
  }
272
299
  else if (erro instanceof excecoes_1.ExcecaoContinuar) {
@@ -275,19 +302,19 @@ var InterpretadorEguaClassico = /** @class */ (function () {
275
302
  throw erro;
276
303
  }
277
304
  }
278
- if (stmt.incrementar !== null) {
279
- this.avaliar(stmt.incrementar);
305
+ if (declaracao.incrementar !== null) {
306
+ this.avaliar(declaracao.incrementar);
280
307
  }
281
308
  }
282
309
  return null;
283
310
  };
284
- InterpretadorEguaClassico.prototype.visitarExpressaoFazer = function (stmt) {
311
+ InterpretadorEguaClassico.prototype.visitarExpressaoFazer = function (declaracao) {
285
312
  do {
286
313
  try {
287
- this.executar(stmt.doBranch);
314
+ this.executar(declaracao.caminhoFazer);
288
315
  }
289
316
  catch (erro) {
290
- if (erro instanceof excecoes_1.ExcecaoQuebra) {
317
+ if (erro instanceof excecoes_1.ExcecaoSustar) {
291
318
  break;
292
319
  }
293
320
  else if (erro instanceof excecoes_1.ExcecaoContinuar) {
@@ -296,22 +323,22 @@ var InterpretadorEguaClassico = /** @class */ (function () {
296
323
  throw erro;
297
324
  }
298
325
  }
299
- } while (this.eVerdadeiro(this.avaliar(stmt.whileCondition)));
326
+ } while (this.eVerdadeiro(this.avaliar(declaracao.condicaoEnquanto)));
300
327
  };
301
- InterpretadorEguaClassico.prototype.visitarExpressaoEscolha = function (stmt) {
302
- var switchCondition = this.avaliar(stmt.condicao);
303
- var branches = stmt.branches;
304
- var defaultBranch = stmt.defaultBranch;
305
- var matched = false;
328
+ InterpretadorEguaClassico.prototype.visitarExpressaoEscolha = function (declaracao) {
329
+ var condicaoEscolha = this.avaliar(declaracao.condicao);
330
+ var caminhos = declaracao.caminhos;
331
+ var caminhoPadrao = declaracao.caminhoPadrao;
332
+ var encontrado = false;
306
333
  try {
307
- for (var i = 0; i < branches.length; i++) {
308
- var branch = branches[i];
309
- for (var j = 0; j < branch.conditions.length; j++) {
310
- if (this.avaliar(branch.conditions[j]) === switchCondition) {
311
- matched = true;
334
+ for (var i = 0; i < caminhos.length; i++) {
335
+ var caminho_1 = caminhos[i];
336
+ for (var j = 0; j < caminho_1.conditions.length; j++) {
337
+ if (this.avaliar(caminho_1.conditions[j]) === condicaoEscolha) {
338
+ encontrado = true;
312
339
  try {
313
- for (var k = 0; k < branch.stmts.length; k++) {
314
- this.executar(branch.stmts[k]);
340
+ for (var k = 0; k < caminho_1.declaracoes.length; k++) {
341
+ this.executar(caminho_1.declaracoes[k]);
315
342
  }
316
343
  }
317
344
  catch (erro) {
@@ -324,48 +351,48 @@ var InterpretadorEguaClassico = /** @class */ (function () {
324
351
  }
325
352
  }
326
353
  }
327
- if (defaultBranch !== null && matched === false) {
328
- for (var i = 0; i < defaultBranch.stmts.length; i++) {
329
- this.executar(defaultBranch["stmts"][i]);
354
+ if (caminhoPadrao !== null && encontrado === false) {
355
+ for (var i = 0; i < caminhoPadrao.declaracoes.length; i++) {
356
+ this.executar(caminhoPadrao['declaracoes'][i]);
330
357
  }
331
358
  }
332
359
  }
333
360
  catch (erro) {
334
- if (erro instanceof excecoes_1.ExcecaoQuebra) {
361
+ if (erro instanceof excecoes_1.ExcecaoSustar) {
335
362
  }
336
363
  else {
337
364
  throw erro;
338
365
  }
339
366
  }
340
367
  };
341
- InterpretadorEguaClassico.prototype.visitarExpressaoTente = function (stmt) {
368
+ InterpretadorEguaClassico.prototype.visitarExpressaoTente = function (declaracao) {
342
369
  try {
343
370
  var sucesso = true;
344
371
  try {
345
- this.executarBloco(stmt.tryBranch, new ambiente_1.Ambiente(this.ambiente));
372
+ this.executarBloco(declaracao.caminhoTente, new ambiente_1.Ambiente(this.ambiente));
346
373
  }
347
374
  catch (erro) {
348
375
  sucesso = false;
349
- if (stmt.catchBranch !== null) {
350
- this.executarBloco(stmt.catchBranch, new ambiente_1.Ambiente(this.ambiente));
376
+ if (declaracao.caminhoPegue !== null) {
377
+ this.executarBloco(declaracao.caminhoPegue, new ambiente_1.Ambiente(this.ambiente));
351
378
  }
352
379
  }
353
- if (sucesso && stmt.elseBranch !== null) {
354
- this.executarBloco(stmt.elseBranch, new ambiente_1.Ambiente(this.ambiente));
380
+ if (sucesso && declaracao.caminhoSenao !== null) {
381
+ this.executarBloco(declaracao.caminhoSenao, new ambiente_1.Ambiente(this.ambiente));
355
382
  }
356
383
  }
357
384
  finally {
358
- if (stmt.finallyBranch !== null)
359
- this.executarBloco(stmt.finallyBranch, new ambiente_1.Ambiente(this.ambiente));
385
+ if (declaracao.caminhoFinalmente !== null)
386
+ this.executarBloco(declaracao.caminhoFinalmente, new ambiente_1.Ambiente(this.ambiente));
360
387
  }
361
388
  };
362
- InterpretadorEguaClassico.prototype.visitarExpressaoEnquanto = function (stmt) {
363
- while (this.eVerdadeiro(this.avaliar(stmt.condicao))) {
389
+ InterpretadorEguaClassico.prototype.visitarExpressaoEnquanto = function (declaracao) {
390
+ while (this.eVerdadeiro(this.avaliar(declaracao.condicao))) {
364
391
  try {
365
- this.executar(stmt.corpo);
392
+ this.executar(declaracao.corpo);
366
393
  }
367
394
  catch (erro) {
368
- if (erro instanceof excecoes_1.ExcecaoQuebra) {
395
+ if (erro instanceof excecoes_1.ExcecaoSustar) {
369
396
  break;
370
397
  }
371
398
  else if (erro instanceof excecoes_1.ExcecaoContinuar) {
@@ -377,21 +404,20 @@ var InterpretadorEguaClassico = /** @class */ (function () {
377
404
  }
378
405
  return null;
379
406
  };
380
- InterpretadorEguaClassico.prototype.visitarExpressaoImportar = function (stmt) {
381
- var caminhoRelativo = this.avaliar(stmt.caminho);
407
+ InterpretadorEguaClassico.prototype.visitarExpressaoImportar = function (declaracao) {
408
+ var caminhoRelativo = this.avaliar(declaracao.caminho);
382
409
  var caminhoTotal = caminho.join(this.diretorioBase, caminhoRelativo);
383
- // const pastaTotal = caminho.dirname(caminhoTotal);
384
410
  var nomeArquivo = caminho.basename(caminhoTotal);
385
411
  var dados = (0, importar_biblioteca_1.default)(caminhoRelativo);
386
412
  if (dados)
387
413
  return dados;
388
414
  try {
389
415
  if (!fs.existsSync(caminhoTotal)) {
390
- throw new excecoes_1.ErroEmTempoDeExecucao(stmt.closeBracket, "Não foi possível encontrar arquivo importado.");
416
+ throw new excecoes_1.ErroEmTempoDeExecucao(declaracao.simboloFechamento, 'Não foi possível encontrar arquivo importado.', declaracao.linha);
391
417
  }
392
418
  }
393
419
  catch (erro) {
394
- throw new excecoes_1.ErroEmTempoDeExecucao(stmt.closeBracket, "Não foi possível ler o arquivo.");
420
+ throw new excecoes_1.ErroEmTempoDeExecucao(declaracao.simboloFechamento, 'Não foi possível ler o arquivo.', declaracao.linha);
395
421
  }
396
422
  dados = fs.readFileSync(caminhoTotal).toString();
397
423
  var delegua = new delegua_1.Delegua(this.Delegua.dialeto, false, nomeArquivo);
@@ -408,8 +434,8 @@ var InterpretadorEguaClassico = /** @class */ (function () {
408
434
  }
409
435
  return exportar;
410
436
  };
411
- InterpretadorEguaClassico.prototype.visitarExpressaoEscreva = function (stmt) {
412
- var valor = this.avaliar(stmt.expressao);
437
+ InterpretadorEguaClassico.prototype.visitarExpressaoEscreva = function (declaracao) {
438
+ var valor = this.avaliar(declaracao.expressao);
413
439
  console.log(this.paraTexto(valor));
414
440
  return null;
415
441
  };
@@ -431,37 +457,37 @@ var InterpretadorEguaClassico = /** @class */ (function () {
431
457
  this.ambiente = anterior;
432
458
  }
433
459
  };
434
- InterpretadorEguaClassico.prototype.visitarExpressaoBloco = function (stmt) {
435
- this.executarBloco(stmt.declaracoes, new ambiente_1.Ambiente(this.ambiente));
460
+ InterpretadorEguaClassico.prototype.visitarExpressaoBloco = function (declaracao) {
461
+ this.executarBloco(declaracao.declaracoes, new ambiente_1.Ambiente(this.ambiente));
436
462
  return null;
437
463
  };
438
- InterpretadorEguaClassico.prototype.visitarExpressaoVar = function (stmt) {
464
+ InterpretadorEguaClassico.prototype.visitarExpressaoVar = function (declaracao) {
439
465
  var valor = null;
440
- if (stmt.inicializador !== null) {
441
- valor = this.avaliar(stmt.inicializador);
466
+ if (declaracao.inicializador !== null) {
467
+ valor = this.avaliar(declaracao.inicializador);
442
468
  }
443
- this.ambiente.definirVariavel(stmt.nome.lexema, valor);
469
+ this.ambiente.definirVariavel(declaracao.simbolo.lexema, valor);
444
470
  return null;
445
471
  };
446
- InterpretadorEguaClassico.prototype.visitarExpressaoContinua = function (stmt) {
472
+ InterpretadorEguaClassico.prototype.visitarExpressaoContinua = function (declaracao) {
447
473
  throw new excecoes_1.ExcecaoContinuar();
448
474
  };
449
- InterpretadorEguaClassico.prototype.visitarExpressaoPausa = function (stmt) {
450
- throw new excecoes_1.ExcecaoQuebra();
475
+ InterpretadorEguaClassico.prototype.visitarExpressaoSustar = function (declaracao) {
476
+ throw new excecoes_1.ExcecaoSustar();
451
477
  };
452
- InterpretadorEguaClassico.prototype.visitarExpressaoRetornar = function (stmt) {
478
+ InterpretadorEguaClassico.prototype.visitarExpressaoRetornar = function (declaracao) {
453
479
  var valor = null;
454
- if (stmt.valor != null)
455
- valor = this.avaliar(stmt.valor);
480
+ if (declaracao.valor != null)
481
+ valor = this.avaliar(declaracao.valor);
456
482
  throw new excecoes_1.ExcecaoRetornar(valor);
457
483
  };
458
- InterpretadorEguaClassico.prototype.visitarExpressaoDeleguaFuncao = function (expr) {
459
- return new funcao_1.DeleguaFuncao(null, expr, this.ambiente, false);
484
+ InterpretadorEguaClassico.prototype.visitarExpressaoDeleguaFuncao = function (expressao) {
485
+ return new funcao_1.DeleguaFuncao(null, expressao, this.ambiente, false);
460
486
  };
461
- InterpretadorEguaClassico.prototype.visitarExpressaoAtribuicaoSobrescrita = function (expr) {
462
- var objeto = this.avaliar(expr.objeto);
463
- var indice = this.avaliar(expr.indice);
464
- var valor = this.avaliar(expr.valor);
487
+ InterpretadorEguaClassico.prototype.visitarExpressaoAtribuicaoSobrescrita = function (expressao) {
488
+ var objeto = this.avaliar(expressao.objeto);
489
+ var indice = this.avaliar(expressao.indice);
490
+ var valor = this.avaliar(expressao.valor);
465
491
  if (Array.isArray(objeto)) {
466
492
  if (indice < 0 && objeto.length !== 0) {
467
493
  while (indice < 0) {
@@ -481,15 +507,15 @@ var InterpretadorEguaClassico = /** @class */ (function () {
481
507
  objeto[indice] = valor;
482
508
  }
483
509
  else {
484
- throw new excecoes_1.ErroEmTempoDeExecucao(expr.objeto.nome, "Somente listas, dicionários, classes e objetos podem ser mudados por sobrescrita.");
510
+ throw new excecoes_1.ErroEmTempoDeExecucao(expressao.objeto.nome, 'Somente listas, dicionários, classes e objetos podem ser mudados por sobrescrita.', expressao.linha);
485
511
  }
486
512
  };
487
- InterpretadorEguaClassico.prototype.visitarExpressaoVetorIndice = function (expressao) {
513
+ InterpretadorEguaClassico.prototype.visitarExpressaoAcessoIndiceVariavel = function (expressao) {
488
514
  var objeto = this.avaliar(expressao.entidadeChamada);
489
515
  var indice = this.avaliar(expressao.indice);
490
516
  if (Array.isArray(objeto)) {
491
517
  if (!Number.isInteger(indice)) {
492
- throw new excecoes_1.ErroEmTempoDeExecucao(expressao.closeBracket, "Somente inteiros podem ser usados para indexar um vetor.");
518
+ throw new excecoes_1.ErroEmTempoDeExecucao(expressao.simboloFechamento, 'Somente inteiros podem ser usados para indexar um vetor.', expressao.linha);
493
519
  }
494
520
  if (indice < 0 && objeto.length !== 0) {
495
521
  while (indice < 0) {
@@ -497,7 +523,7 @@ var InterpretadorEguaClassico = /** @class */ (function () {
497
523
  }
498
524
  }
499
525
  if (indice >= objeto.length) {
500
- throw new excecoes_1.ErroEmTempoDeExecucao(expressao.closeBracket, "Índice do vetor fora do intervalo.");
526
+ throw new excecoes_1.ErroEmTempoDeExecucao(expressao.simboloFechamento, 'Índice do vetor fora do intervalo.', expressao.linha);
501
527
  }
502
528
  return objeto[indice];
503
529
  }
@@ -508,9 +534,9 @@ var InterpretadorEguaClassico = /** @class */ (function () {
508
534
  objeto instanceof modulo_1.DeleguaModulo) {
509
535
  return objeto[indice] || null;
510
536
  }
511
- else if (typeof objeto === "string") {
537
+ else if (typeof objeto === 'string') {
512
538
  if (!Number.isInteger(indice)) {
513
- throw new excecoes_1.ErroEmTempoDeExecucao(expressao.closeBracket, "Somente inteiros podem ser usados para indexar um vetor.");
539
+ throw new excecoes_1.ErroEmTempoDeExecucao(expressao.simboloFechamento, 'Somente inteiros podem ser usados para indexar um vetor.', expressao.linha);
514
540
  }
515
541
  if (indice < 0 && objeto.length !== 0) {
516
542
  while (indice < 0) {
@@ -518,123 +544,123 @@ var InterpretadorEguaClassico = /** @class */ (function () {
518
544
  }
519
545
  }
520
546
  if (indice >= objeto.length) {
521
- throw new excecoes_1.ErroEmTempoDeExecucao(expressao.closeBracket, "Índice fora do tamanho.");
547
+ throw new excecoes_1.ErroEmTempoDeExecucao(expressao.simboloFechamento, 'Índice fora do tamanho.', expressao.linha);
522
548
  }
523
549
  return objeto.charAt(indice);
524
550
  }
525
551
  else {
526
- throw new excecoes_1.ErroEmTempoDeExecucao(expressao.entidadeChamada.nome, "Somente listas, dicionários, classes e objetos podem ser mudados por sobrescrita.");
552
+ throw new excecoes_1.ErroEmTempoDeExecucao(expressao.entidadeChamada.nome, 'Somente listas, dicionários, classes e objetos podem ser mudados por sobrescrita.', expressao.linha);
527
553
  }
528
554
  };
529
- InterpretadorEguaClassico.prototype.visitarExpressaoDefinir = function (expr) {
530
- var objeto = this.avaliar(expr.objeto);
555
+ InterpretadorEguaClassico.prototype.visitarExpressaoDefinir = function (expressao) {
556
+ var objeto = this.avaliar(expressao.objeto);
531
557
  if (!(objeto instanceof instancia_1.DeleguaInstancia) &&
532
558
  objeto.constructor !== Object) {
533
- throw new excecoes_1.ErroEmTempoDeExecucao(expr.objeto.nome, "Somente instâncias e dicionários podem possuir campos.");
559
+ throw new excecoes_1.ErroEmTempoDeExecucao(expressao.objeto.nome, 'Somente instâncias e dicionários podem possuir campos.', expressao.linha);
534
560
  }
535
- var valor = this.avaliar(expr.valor);
561
+ var valor = this.avaliar(expressao.valor);
536
562
  if (objeto instanceof instancia_1.DeleguaInstancia) {
537
- objeto.set(expr.nome, valor);
563
+ objeto.set(expressao.nome, valor);
538
564
  return valor;
539
565
  }
540
566
  else if (objeto.constructor === Object) {
541
- objeto[expr.nome.lexema] = valor;
567
+ objeto[expressao.simbolo.lexema] = valor;
542
568
  }
543
569
  };
544
- InterpretadorEguaClassico.prototype.visitarExpressaoFuncao = function (stmt) {
545
- var funcao = new funcao_1.DeleguaFuncao(stmt.nome.lexema, stmt.funcao, this.ambiente, false);
546
- this.ambiente.definirVariavel(stmt.nome.lexema, funcao);
570
+ InterpretadorEguaClassico.prototype.visitarExpressaoFuncao = function (declaracao) {
571
+ var funcao = new funcao_1.DeleguaFuncao(declaracao.simbolo.lexema, declaracao.funcao, this.ambiente, false);
572
+ this.ambiente.definirVariavel(declaracao.simbolo.lexema, funcao);
547
573
  };
548
- InterpretadorEguaClassico.prototype.visitarExpressaoClasse = function (stmt) {
574
+ InterpretadorEguaClassico.prototype.visitarExpressaoClasse = function (declaracao) {
549
575
  var superClasse = null;
550
- if (stmt.superClasse !== null) {
551
- superClasse = this.avaliar(stmt.superClasse);
576
+ if (declaracao.superClasse !== null) {
577
+ superClasse = this.avaliar(declaracao.superClasse);
552
578
  if (!(superClasse instanceof classe_1.DeleguaClasse)) {
553
- throw new excecoes_1.ErroEmTempoDeExecucao(stmt.superClasse.nome, "SuperClasse precisa ser uma classe.");
579
+ throw new excecoes_1.ErroEmTempoDeExecucao(declaracao.superClasse.nome, 'SuperClasse precisa ser uma classe.', declaracao.linha);
554
580
  }
555
581
  }
556
- this.ambiente.definirVariavel(stmt.nome.lexema, null);
557
- if (stmt.superClasse !== null) {
582
+ this.ambiente.definirVariavel(declaracao.simbolo.lexema, null);
583
+ if (declaracao.superClasse !== null) {
558
584
  this.ambiente = new ambiente_1.Ambiente(this.ambiente);
559
- this.ambiente.definirVariavel("super", superClasse);
585
+ this.ambiente.definirVariavel('super', superClasse);
560
586
  }
561
587
  var metodos = {};
562
- var definirMetodos = stmt.metodos;
563
- for (var i = 0; i < stmt.metodos.length; i++) {
588
+ var definirMetodos = declaracao.metodos;
589
+ for (var i = 0; i < declaracao.metodos.length; i++) {
564
590
  var metodoAtual = definirMetodos[i];
565
- var eInicializado = metodoAtual.nome.lexema === "construtor";
566
- var funcao = new funcao_1.DeleguaFuncao(metodoAtual.nome.lexema, metodoAtual.funcao, this.ambiente, eInicializado);
567
- metodos[metodoAtual.nome.lexema] = funcao;
591
+ var eInicializado = metodoAtual.simbolo.lexema === 'construtor';
592
+ var funcao = new funcao_1.DeleguaFuncao(metodoAtual.simbolo.lexema, metodoAtual.funcao, this.ambiente, eInicializado);
593
+ metodos[metodoAtual.simbolo.lexema] = funcao;
568
594
  }
569
- var criado = new classe_1.DeleguaClasse(stmt.nome.lexema, superClasse, metodos);
595
+ var criado = new classe_1.DeleguaClasse(declaracao.simbolo.lexema, superClasse, metodos);
570
596
  if (superClasse !== null) {
571
597
  this.ambiente = this.ambiente.enclosing;
572
598
  }
573
- this.ambiente.atribuirVariavel(stmt.nome, criado);
599
+ this.ambiente.atribuirVariavel(declaracao.simbolo, criado);
574
600
  return null;
575
601
  };
576
- InterpretadorEguaClassico.prototype.visitarExpressaoObter = function (expr) {
577
- var objeto = this.avaliar(expr.objeto);
602
+ InterpretadorEguaClassico.prototype.visitarExpressaoAcessoMetodo = function (expressao) {
603
+ var objeto = this.avaliar(expressao.objeto);
578
604
  if (objeto instanceof instancia_1.DeleguaInstancia) {
579
- return objeto.get(expr.nome) || null;
605
+ return objeto.get(expressao.simbolo) || null;
580
606
  }
581
607
  else if (objeto.constructor === Object) {
582
- return objeto[expr.nome.lexema] || null;
608
+ return objeto[expressao.simbolo.lexema] || null;
583
609
  }
584
610
  else if (objeto instanceof modulo_1.DeleguaModulo) {
585
- return objeto[expr.nome.lexema] || null;
611
+ return objeto[expressao.simbolo.lexema] || null;
586
612
  }
587
- throw new excecoes_1.ErroEmTempoDeExecucao(expr.nome, "Você só pode acessar métodos do objeto e dicionários.");
613
+ throw new excecoes_1.ErroEmTempoDeExecucao(expressao.nome, 'Você só pode acessar métodos do objeto e dicionários.', expressao.linha);
588
614
  };
589
- InterpretadorEguaClassico.prototype.visitarExpressaoIsto = function (expr) {
590
- return this.procurarVariavel(expr.palavraChave, expr);
615
+ InterpretadorEguaClassico.prototype.visitarExpressaoIsto = function (expressao) {
616
+ return this.procurarVariavel(expressao.palavraChave, expressao);
591
617
  };
592
- InterpretadorEguaClassico.prototype.visitarExpressaoDicionario = function (expr) {
618
+ InterpretadorEguaClassico.prototype.visitarExpressaoDicionario = function (expressao) {
593
619
  var dicionario = {};
594
- for (var i = 0; i < expr.chaves.length; i++) {
595
- dicionario[this.avaliar(expr.chaves[i])] = this.avaliar(expr.valores[i]);
620
+ for (var i = 0; i < expressao.chaves.length; i++) {
621
+ dicionario[this.avaliar(expressao.chaves[i])] = this.avaliar(expressao.valores[i]);
596
622
  }
597
623
  return dicionario;
598
624
  };
599
- InterpretadorEguaClassico.prototype.visitarExpressaoVetor = function (expr) {
625
+ InterpretadorEguaClassico.prototype.visitarExpressaoVetor = function (expressao) {
600
626
  var valores = [];
601
- for (var i = 0; i < expr.valores.length; i++) {
602
- valores.push(this.avaliar(expr.valores[i]));
627
+ for (var i = 0; i < expressao.valores.length; i++) {
628
+ valores.push(this.avaliar(expressao.valores[i]));
603
629
  }
604
630
  return valores;
605
631
  };
606
- InterpretadorEguaClassico.prototype.visitarExpressaoSuper = function (expr) {
607
- var distancia = this.locais.get(expr);
608
- var superClasse = this.ambiente.obterVariavelEm(distancia, "super");
609
- var objeto = this.ambiente.obterVariavelEm(distancia - 1, "isto");
610
- var metodo = superClasse.encontrarMetodo(expr.metodo.lexema);
632
+ InterpretadorEguaClassico.prototype.visitarExpressaoSuper = function (expressao) {
633
+ var distancia = this.locais.get(expressao);
634
+ var superClasse = this.ambiente.obterVariavelEm(distancia, 'super');
635
+ var objeto = this.ambiente.obterVariavelEm(distancia - 1, 'isto');
636
+ var metodo = superClasse.encontrarMetodo(expressao.metodo.lexema);
611
637
  if (metodo === undefined) {
612
- throw new excecoes_1.ErroEmTempoDeExecucao(expr.metodo, "Método chamado indefinido.");
638
+ throw new excecoes_1.ErroEmTempoDeExecucao(expressao.metodo, 'Método chamado indefinido.', expressao.linha);
613
639
  }
614
640
  return metodo.definirEscopo(objeto);
615
641
  };
616
642
  InterpretadorEguaClassico.prototype.paraTexto = function (objeto) {
617
643
  if (objeto === null)
618
- return "nulo";
619
- if (typeof objeto === "boolean") {
620
- return objeto ? "verdadeiro" : "falso";
644
+ return 'nulo';
645
+ if (typeof objeto === 'boolean') {
646
+ return objeto ? 'verdadeiro' : 'falso';
621
647
  }
622
648
  if (objeto instanceof Date) {
623
- var formato = Intl.DateTimeFormat("pt", {
624
- dateStyle: "full",
625
- timeStyle: "full",
649
+ var formato = Intl.DateTimeFormat('pt', {
650
+ dateStyle: 'full',
651
+ timeStyle: 'full',
626
652
  });
627
653
  return formato.format(objeto);
628
654
  }
629
655
  if (Array.isArray(objeto))
630
656
  return objeto;
631
- if (typeof objeto === "object")
657
+ if (typeof objeto === 'object')
632
658
  return JSON.stringify(objeto);
633
659
  return objeto.toString();
634
660
  };
635
- InterpretadorEguaClassico.prototype.executar = function (stmt, mostrarResultado) {
661
+ InterpretadorEguaClassico.prototype.executar = function (declaracao, mostrarResultado) {
636
662
  if (mostrarResultado === void 0) { mostrarResultado = false; }
637
- stmt.aceitar(this);
663
+ declaracao.aceitar(this);
638
664
  };
639
665
  InterpretadorEguaClassico.prototype.interpretar = function (declaracoes) {
640
666
  try {