From f18d1d3b57018b7af91fa78a04208036394a6260 Mon Sep 17 00:00:00 2001 From: Andre0n Date: Sun, 8 Jan 2023 12:20:46 -0300 Subject: [PATCH 1/2] =?UTF-8?q?Remo=C3=A7=C3=A3o=20de=20c=C3=B3digo=20mort?= =?UTF-8?q?o=20no=20`runPrompt()`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/egua.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/egua.js b/src/egua.js index cf251b1..d401be0 100644 --- a/src/egua.js +++ b/src/egua.js @@ -16,7 +16,7 @@ module.exports.Egua = class Egua { } runPrompt() { - const interpreter = new Interpreter(this, process.cwd(), undefined); + const interpreter = new Interpreter(this, process.cwd()); console.log("Console da Linguagem Égua"); const rl = readline.createInterface({ input: process.stdin, From a921c7d545ed163e23ce68ce99134e05b2f6dfbd Mon Sep 17 00:00:00 2001 From: Andre0n Date: Sun, 8 Jan 2023 14:07:35 -0300 Subject: [PATCH 2/2] =?UTF-8?q?Corrige=20bug=20na=20declara=C3=A7=C3=A3o?= =?UTF-8?q?=20de=20fun=C3=A7=C3=B5es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Corrigindo bug que permite declarar funções sem identificador no escopo global. --- src/parser.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/parser.js b/src/parser.js index e919014..165222e 100644 --- a/src/parser.js +++ b/src/parser.js @@ -798,10 +798,7 @@ module.exports = class Parser { declaration() { try { - if ( - this.check(tokenTypes.FUNÇÃO) && - this.checkNext(tokenTypes.IDENTIFIER) - ) { + if (this.check(tokenTypes.FUNÇÃO)) { this.consume(tokenTypes.FUNÇÃO, null); return this.function("função"); }