Skip to content

Commit

Permalink
Merge branch 'principal' of https://github.com/DesignLiquido/delegua
Browse files Browse the repository at this point in the history
…into principal
  • Loading branch information
leonelsanchesdasilva committed Jan 29, 2024
2 parents af5c0fe + 01ba31e commit 47c65e9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fontes/interpretador/interpretador-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,11 @@ export class InterpretadorBase implements InterpretadorInterface {
: typeof esquerda === tipoDeDadosPrimitivos.NUMERO
? tipoDeDadosDelegua.NUMERO
: String(NaN);
if (tipoDireita === tipoDeDadosDelegua.NUMERO && tipoEsquerda === tipoDeDadosDelegua.NUMERO) return;

const tiposNumericos = [tipoDeDadosDelegua.INTEIRO, tipoDeDadosDelegua.NUMERO];

if(tiposNumericos.includes(tipoDireita) && tiposNumericos.includes(tipoEsquerda)) return;

throw new ErroEmTempoDeExecucao(operador, 'Operadores precisam ser números.', operador.linha);
}

Expand Down

0 comments on commit 47c65e9

Please sign in to comment.