Skip to content

Commit

Permalink
fix: adicionando verificação para tipo de dados Delegua número
Browse files Browse the repository at this point in the history
  • Loading branch information
Aristidescosta committed Feb 18, 2024
1 parent c687d46 commit 8b67204
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions fontes/interpretador/interpretador-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ export class InterpretadorBase implements InterpretadorInterface {

regexInterpolacao = /\${(.*?)}/g;
private tiposNumericos = [
tipoDeDadosDelegua.INTEIRO,
tipoDeDadosDelegua.NUMERO,
tipoDeDadosDelegua.NÚMERO,
tipoDeDadosDelegua.INTEIRO,
tipoDeDadosDelegua.NUMERO,
tipoDeDadosDelegua.NÚMERO,
tipoDeDadosDelegua.REAL
];

Expand Down Expand Up @@ -528,7 +528,7 @@ export class InterpretadorBase implements InterpretadorInterface {
return Math.pow(valorEsquerdo, valorDireito);

case tiposDeSimbolos.MAIOR:
if (tipoEsquerdo === tipoDeDadosDelegua.NUMERO && tipoDireito === tipoDeDadosDelegua.NUMERO) {
if ((tipoEsquerdo === tipoDeDadosDelegua.NUMERO) || (tipoEsquerdo === tipoDeDadosDelegua.NÚMERO) && (tipoDireito === tipoDeDadosDelegua.NUMERO) || (tipoDireito === tipoDeDadosDelegua.NÚMERO)) {
return Number(valorEsquerdo) > Number(valorDireito);
}

Expand All @@ -539,7 +539,7 @@ export class InterpretadorBase implements InterpretadorInterface {
return Number(valorEsquerdo) >= Number(valorDireito);

case tiposDeSimbolos.MENOR:
if (tipoEsquerdo === tipoDeDadosDelegua.NUMERO && tipoDireito === tipoDeDadosDelegua.NUMERO) {
if ((tipoEsquerdo === tipoDeDadosDelegua.NUMERO) || (tipoEsquerdo === tipoDeDadosDelegua.NÚMERO) && (tipoDireito === tipoDeDadosDelegua.NUMERO) || (tipoDireito === tipoDeDadosDelegua.NÚMERO)) {
return Number(valorEsquerdo) < Number(valorDireito);
}

Expand Down

0 comments on commit 8b67204

Please sign in to comment.