Integração do PR #52: if-elif-else + correção de keyword#64
Merged
RafaelLopes23 merged 5 commits intoUnBCIC-TP2:develop-Rafaelfrom Sep 3, 2025
Merged
Conversation
…corrige função 'keyword'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolução de conflitos
Arquivo: parser_stmt.rs
parse_if_chain_statemente, noparse_statement, ela é chamada antes deparse_if_else_statementpara reconhecer corretamente cadeias comelif.parse_if_else_statementpara compatibilidade com if/else simples.test_parse_if_chain_statement(if, if-else, if-elif, if-elif-else) no módulo de testes de statements.testdef_testsapenas para funções de teste (test functions).assert_testspara asserts.testdef_testspois ele não é sobre “test functions”; faz sentido permanecer junto aos demais testes de statements.Arquivo: parser_common.rs
keyword: uso determinated(tag(kw), peek(not(alphanumeric1)))commultispace0, impedindo que “ifx” seja lido como “if”.Observações sobre o PR (Observação feita com auxilio do Copilot, usando GPT-5, achei interessante colocar aqui.)
Statement::IfChain. O interpretador e o type checker ainda não tratamIfChaindiretamente; hoje não impacta porque os testes adicionados exercitam o parser. Próximos passos possíveis:IfChainno interpretador e no verificador de tipos; ouIfChainparaIfThenElseaninhado no próprio parser para manter compatibilidade com o runtime atual.elif.