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.
Description
This pull request introduces several enhancements and fixes to the codebase, primarily focusing on function handling, scope management, and debugging capabilities. The most important changes include adding a debug build target, improving function call handling, and updating test cases to reflect new functionality.
Build System Improvements:
DEBUG_FLAGS := -g
toMakefile
and introduced a newdebug
target for compiling debug builds with GDB support. [1] [2]Function Handling Enhancements:
get_expression_type
by looking up the function's return type in the symbol table.enter_function_scope
to handle function scope entry and parameter assignment, replacing the previous manual parameter handling inexecute_function_call
. [1] [2]handle_return_statement
to clean up all scopes until the function scope is reached.Scope Management:
get_variable
to returnNULL
if the current scope is a function scope, ensuring proper variable resolution.is_function_scope
to theScope
structure to differentiate function scopes from other scopes.Test Case Updates:
fib.brainrot
andfunc_scope.brainrot
to verify the correct behavior of recursive functions and function scope handling. [1] [2]expected_results.json
to include expected outputs for the new test cases.Related Issue
#115
Fixes #<issue_number>
Type of Change
Checklist