Skip to content

Commit

Permalink
Aceitando nomes de tipos com ou sem acento para conversões de valores.
Browse files Browse the repository at this point in the history
  • Loading branch information
leonelsanchesdasilva committed May 18, 2024
1 parent 537b26b commit 0805cb6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fontes/interpretador/pilha-escopos-execucao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { EscopoExecucao } from '../interfaces/escopo-execucao';
import { PilhaEscoposExecucaoInterface } from '../interfaces/pilha-escopos-execucao-interface';
import { Simbolo } from '../lexador';
import { TipoInferencia, inferirTipoVariavel } from './inferenciador';

import tipoDeDadosDelegua from '../tipos-de-dados/delegua';

export class PilhaEscoposExecucao implements PilhaEscoposExecucaoInterface {
Expand Down Expand Up @@ -44,8 +45,10 @@ export class PilhaEscoposExecucao implements PilhaEscoposExecucaoInterface {
switch (tipo) {
case 'inteiro':
return parseInt(valor);
case 'logico':
case 'lógico':
return Boolean(valor);
case 'numero':
case 'número':
return Number(valor);
case 'texto':
Expand Down

0 comments on commit 0805cb6

Please sign in to comment.