Skip to content

Conversation

RafaelLopes23
Copy link
Collaborator

…plementação.

Copy link
Collaborator

@helpmehelpus helpmehelpus left a comment

Choose a reason for hiding this comment

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

ótimo trabalho! deixei alguns comentários e uma pergunta. a CI está falhando porque falta rodar cargo fmt para aplicar a formatação padrão

README Outdated
@@ -0,0 +1,203 @@
# R-Python: Um Interpretador Python em Rust
Copy link
Collaborator

Choose a reason for hiding this comment

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

Este README esta bom em principio. No entanto, se formos ser detalhados assim, vai ser complicado manter ela sincronizada conforme a implementação avançar. Talvez valha mais a pena sermos mais alto nível aqui, e considerarmos documentação propriamente como sugerida por Rust: usando ///.


#[derive(Debug, Clone)]
pub enum Statement {
VarDeclaration(Box<Name>),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sugestão: incorporar #5. Name é alias para String, que já é tipo de dado com tamanho variável alocado na heap, não precisando estar wrapped por uma Box.

src/main.rs Outdated
y = 1
else:
y = 2"#;
run_test("Basic if-else", test1);
Copy link
Collaborator

Choose a reason for hiding this comment

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

acredito que devemos mover todos estes testes para fora da main.

assert_eq!(rest, "");
match stmt {
Statement::Assignment(name, expr) => {
assert_eq!(&**name, "x"); // Compare &str with &str
Copy link
Collaborator

Choose a reason for hiding this comment

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

não baixei o branch para checar, mas acho que assert_eq!(name.as_str(), "x"); atinge o mesmo objetivo com uma sintaxe mais amigável. Pode confirmar por favor?

assert_eq!(rest, "");
assert_eq!(stmts.len(), 2);
}
} No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

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

excelentes testes

@RafaelLopes23
Copy link
Collaborator Author

ótimo trabalho! deixei alguns comentários e uma pergunta. a CI está falhando porque falta rodar cargo fmt para aplicar a formatação padrão

obrigado pelo feedback! estou gostando de trabalhar nessa implementação. Você me recomendaria rodar o cargo fmt e dar commit de novo, ou não é necessário?

sobre o 'assert_eq!(name.as_str(), "x");' dei uma olhada e parece que é sim mais claro com uma sintaxe melhor, não me atentei a isso, mas os dois atingem o mesmo objetivo, como você comentou.

@helpmehelpus
Copy link
Collaborator

sim, outro commit seria legal, garantindo que a CI vai ficar verde e com a mudança na sintaxe dos asserts

@RafaelLopes23
Copy link
Collaborator Author

sim, outro commit seria legal, garantindo que a CI vai ficar verde e com a mudança na sintaxe dos asserts

Rodei o cargo fmt, creio que agora funcione.

EmersonJr pushed a commit to EmersonJr/r-python that referenced this pull request Feb 20, 2025
now tests are fixed and integrated
rbonifacio pushed a commit that referenced this pull request Feb 26, 2025
Parser merge with updated main
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.

2 participants