Skip to content

Commit

Permalink
Desativar verificação de variáveis em escopos de biblioteca
Browse files Browse the repository at this point in the history
Closes #146
  • Loading branch information
dgadelha committed Jan 17, 2024
1 parent 2d6a012 commit c6226c9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/parser/src/errors/02-variáveis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ export function* checarUsoEscopo(arquivo: Arquivo): Generator<PortugolCodeError>
case ReferênciaVarExpr:
const ref = as ReferênciaVarExpr;

// TODO: bibliotecas
if (ref.escopoBiblioteca) {
break;
}

if (!escopo.hasVariável(ref.nome)) {
yield PortugolCodeError.fromContext(ref.ctx, `Variável não declarada: ${ref.nome}`);
}
Expand Down

0 comments on commit c6226c9

Please sign in to comment.