Skip to content

Format Handling, AST Updates, and Hash Map Integration - #111

Merged
LunaStev merged 44 commits into
developfrom
feature/ast
Feb 21, 2025
Merged

LunaStev merged 44 commits into
developfrom
feature/ast

Conversation

@LunaStev

Copy link
Copy Markdown
Member

🚀 Purpose and Functionality of Changes:

This update focuses on improving the formatting, Abstract Syntax Tree (AST) handling, and introducing hash maps within the Wave language:

  • String Formatting Enhancements:

    • Added formatting functionality to control output formatting.
    • AST Updates for Format Handling: Introduced AST nodes for managing formatted output, allowing formatted string parsing.
    • printf_args: Changed function arguments to handle formatted output.
    • Added verification for the number of {} placeholders matching the number of format arguments.
    • Isolated format-related AST codes for cleaner structure.
  • Hash Map Integration:

    • Integrated hash maps into the system, allowing the Wave language to manage key-value pairs efficiently.
  • Functionality to Manage Memory:

    • Added functionality to allocate and load variables using create_alloca.
    • Simplified parameter handling by deleting unnecessary parameters in functions.
  • Debugging and Comment Clean-Up:

    • Removed unused debugging statements and placeholder comments.
    • Cleaned up empty lines and unnecessary comments for better readability.

🛠️ Programming Language Used:

  • Rust: Changes involve handling formatted output, modifying the AST, and integrating new features into Wave.

📚 Libraries Used:

  • Inkwell: For function value management in the LLVM context.
  • Standard Rust Libraries: For handling string formatting and data structures like hash maps.

💡 Technologies or Methodologies Applied:

  • Abstract Syntax Tree (AST): Updated the AST to manage formatted output efficiently.
  • Hash Map Integration: Introduced hash maps to facilitate efficient storage and retrieval of key-value pairs.
  • String Formatting: Incorporated functionality to handle format strings and verify placeholder consistency.

🎯 Impact of the Change:

  • Improved Formatting Control: The new format-related features enhance the readability and control of output in Wave.
  • Hash Map Functionality: The introduction of hash maps enables Wave to handle more complex data structures and operations.
  • Memory Allocation: The new memory handling features simplify variable allocation and ensure more efficient memory usage.

🔧 How to Test:

  1. Test formatted output to verify the number of {} in format strings matches the arguments.
  2. Verify the proper integration of hash maps, ensuring correct key-value pair management.
  3. Ensure functionality for variable allocation and loading works correctly via create_alloca.

🚀 Version Update:

  • v0.0.3-pre-beta: Updated repository version to reflect the new features and fixes.

@LunaStev LunaStev self-assigned this Feb 21, 2025
@LunaStev
LunaStev merged commit e106d16 into develop Feb 21, 2025
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.

1 participant