Skip to content

Conversation

@SIGMazer
Copy link
Member

@SIGMazer SIGMazer commented Oct 4, 2025

Description

This pull request introduces comprehensive support for string variables in the ast.c file. It adds the ability to assign, evaluate, and use string variables in expressions, function calls, and I/O operations, while refactoring type checking and assignment logic to be more generic and extensible. The changes also streamline the handling of type promotion and assignment for all supported variable types.

String variable support and type system improvements:

  • Added support for string variables throughout the interpreter, including assignment (set_string_variable), expression evaluation (evaluate_expression_string), and function call return values. [1] [2] [3] [4]
  • Refactored type checking functions to a generic is_expression method, replacing multiple type-specific checks and updating all usage sites for assignments, I/O, and evaluation. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]
  • Extended variable access and promotion logic to handle string variables in handle_identifier, ensuring correct value retrieval and conversion for all supported types. [1] [2] [3]
  • Updated input/output functions (execute_yapping_call, execute_yappin_call, execute_slorp_call) to correctly process string variables and avoid invalid type errors. [1] [2] [3]
  • Simplified array offset calculation logic for row-major order and improved error messages for out-of-bounds access.

These changes collectively make the interpreter more robust and extensible, especially for string handling and type-specific operations.

Related Issue

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Performance improvement
  • Refactor

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have documented my changes in the code or documentation
  • I have added tests that prove my changes work (if applicable)
  • I have run the unit tests locally
  • I have run the valgrind memory tests locally
  • All new and existing tests pass

@SIGMazer SIGMazer added enhancement New feature or request refactor Modify existing working code but keeping the same functionality. labels Oct 4, 2025
@SIGMazer SIGMazer requested a review from leo-aa88 October 4, 2025 18:11
@SIGMazer SIGMazer merged commit e8347fa into main Oct 8, 2025
2 checks passed
@SIGMazer SIGMazer deleted the feat/rant branch October 8, 2025 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request refactor Modify existing working code but keeping the same functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants