Skip to content

Commit

Permalink
Merge pull request #532 from DesignLiquido/visualg-bug-negativos
Browse files Browse the repository at this point in the history
Corrigindo bug reportado pelo Delpupo no Discord.
  • Loading branch information
samuelrvg authored Oct 21, 2023
2 parents b026afc + 46109ef commit c0c7127
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ export class InterpretadorVisuAlgComDepuracao extends InterpretadorComDepuracao
}

async visitarDeclaracaoPara(declaracao: Para): Promise<any> {
// const cloneDeclaracao = JSON.parse(JSON.stringify(declaracao)) as Para;
const cloneDeclaracao = _.cloneDeep(declaracao) as Para;
const corpoExecucao = cloneDeclaracao.corpo as Bloco;
if (cloneDeclaracao.inicializador !== null) {
Expand All @@ -155,7 +154,6 @@ export class InterpretadorVisuAlgComDepuracao extends InterpretadorComDepuracao
}
}

// cloneDeclaracao.inicializada = true;
const escopoAtual = this.pilhaEscoposExecucao.topoDaPilha();
switch (this.comando) {
case 'proximo':
Expand All @@ -170,7 +168,6 @@ export class InterpretadorVisuAlgComDepuracao extends InterpretadorComDepuracao
}

escopoAtual.emLacoRepeticao = false;
// declaracao.inicializada = false;
return null;
default:
let retornoExecucao: any;
Expand All @@ -195,8 +192,7 @@ export class InterpretadorVisuAlgComDepuracao extends InterpretadorComDepuracao
return Promise.reject(erro);
}
}
// escopoAtual.emLacoRepeticao = false;
// declaracao.inicializada = false;

return retornoExecucao;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ export class InterpretadorVisuAlg extends InterpretadorBase {

async visitarDeclaracaoPara(declaracao: Para): Promise<any> {
if (declaracao.inicializador !== null) {
await comum.resolverIncrementoPara(this, declaracao);
await this.avaliar(declaracao.inicializador);
await comum.resolverIncrementoPara(this, declaracao);
}

let retornoExecucao: any;
Expand Down

0 comments on commit c0c7127

Please sign in to comment.