@designliquido/delegua 0.2.0 → 0.2.3

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