Integração do PR #52: if-elif-else + correção de keyword #64
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_statement
e, noparse_statement
, ela é chamada antes deparse_if_else_statement
para reconhecer corretamente cadeias comelif
.parse_if_else_statement
para 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_tests
apenas para funções de teste (test functions).assert_tests
para asserts.testdef_tests
pois 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 tratamIfChain
diretamente; hoje não impacta porque os testes adicionados exercitam o parser. Próximos passos possíveis:IfChain
no interpretador e no verificador de tipos; ouIfChain
paraIfThenElse
aninhado no próprio parser para manter compatibilidade com o runtime atual.elif
.