Refactoring#43
Merged
rbonifacio merged 26 commits intomainfrom Jun 16, 2025
Merged
Conversation
200d954 to
360acaa
Compare
In this commit, we rename the parser functions, changed the order of the declarations (to simplify program comprehension), and also improve the parser test organization. To this end, we moved the test suite to the 'tests/parser_tests.rs' file. New features in the parse: - parse for statement - parse while statement
…expr, parser_stmt) Also, since we aim to make the code more correct, we decided to remove the code related to the statement 'match-case'.
helpmehelpus
approved these changes
Jun 10, 2025
Collaborator
helpmehelpus
left a comment
There was a problem hiding this comment.
this is colossal work! Some questions did pop in my mind when reading/reviewing, but I ended up forgetting many, don't have too much context in my brain as of yet and feel like we may want to merge this so we can continue working from it.
Are we intentionally leaving all test those blocks commented out and planning to incrementally add them back?
Happy to jump on a call for a quick walk through and maybe pick up a task to start getting my hands dirty on it
…ns and a checker for statements.
…variables - Update Environment to differentiate mutable and non-mutable variables: - Add mutable flag to variable storage in Scope - Update lookup to return (bool, Type) tuple indicating mutability - Modify map_variable to require mutability parameter - Add type checking for new statements: - val declaration (non-mutable) - var declaration (mutable) - if-then-else with proper type checking - for loops with type checking - while loops with type checking - Update test suite: - Add tests for mutable/non-mutable variable behavior - Add tests for new statement type checking - Fix existing tests to declare variables before assignment - Clean up source code: - Remove old type checker files (tc/*) - Reorganize type checking logic - Improve error messages
- Split interpreter.rs into expression_eval.rs and statement_execute.rs - Moved expression evaluation logic into expression_eval.rs - Moved statement execution logic into statement_execute.rs - Created mod.rs to expose the main functions (eval, run, execute) - Removed the old interpreter.rs file - Fixed unused import warning in statement_execute.rs - All tests pass successfully
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.
No description provided.