Skip to content

Lexador emite token INVALIDO para caracteres não reconhecidos#1373

Open
VictorFrancelino wants to merge 1 commit into
principalfrom
1367
Open

Lexador emite token INVALIDO para caracteres não reconhecidos#1373
VictorFrancelino wants to merge 1 commit into
principalfrom
1367

Conversation

@VictorFrancelino

Copy link
Copy Markdown
Contributor

Closes #1367

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

📊 Cobertura de Código

Métrica Cobertura
Linhas 85.1%
Declarações 84.62%
Funções 83.59%
Branches 74.1%

@leonelsanchesdasilva leonelsanchesdasilva left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Desaparecer com erros léxicos não é uma estratégia adequada para resolver o problema. Devemos pensar em uma outra forma.

Comment thread fontes/lexador/lexador.ts
} else if (this.eAlfabeto(c)) {
this.identificarPalavraChave();
} else {
this.erros.push({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nào concordo com essa modificação. Aqui você está simplesmente se livrando de qualquer erro léxico, o que é previsto na arquitetura de Delégua. Quando há um erro léxico, as etapas seguintes não podem seguir. Por isso os testes unitários em outros arquivos não fazem sentido.

],
-1
);
const retornoAvaliadorSintatico = await avaliadorSintatico.analisar(retornoLexador, -1);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quando há um erro léxico, essa etapa nem poderia executar. Isso está presente em todos os componentes que fazem parte de Delégua, como delegua-web, delegua-node e todos os compiladores.

'escreva(teste())',
];
const retornoLexador = lexador.mapear(codigo, -1);
const retornoAvaliadorSintatico = await avaliadorSintatico.analisar(retornoLexador, -1);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Delégua] Falha no tratamento de erro ao definir # como retorno de função

2 participants