Skip to content

Grammar Enhancements and LLVM Codegen Debugging - #109

Merged
LunaStev merged 7 commits into
developfrom
feature/ast
Feb 19, 2025
Merged

LunaStev merged 7 commits into
developfrom
feature/ast

Conversation

@LunaStev

Copy link
Copy Markdown
Member

🚀 Purpose and Functionality of Changes:

This pull request introduces refinements to Wave’s grammar and LLVM code generation:

  • Grammar Enhancements:

    • Introduced a match structure to allow multiple grammar keywords.
    • Modified the grammar to remove the var keyword from parameter definitions, streamlining variable declaration.
  • LLVM Codegen Debugging:

    • Added debug output (Print) to LLVM processing for better visibility during code generation.
    • Introduced cloning mechanisms for debugging to assist in tracing values during compilation.
  • Fixing var Keyword Issues in Parameter Parsing:

    • Identified and resolved an issue where the var keyword caused parsing errors in certain cases.
    • Implemented a fix to immediately break parsing when var appears incorrectly.

🛠️ Programming Language Used:

  • Rust: Changes focus on refining the compiler’s grammar parsing and LLVM-based code generation.

📚 Libraries Used:

  • LLVM (via Inkwell): Adjustments were made to how LLVM processes and debugs Wave’s generated code.

💡 Technologies or Methodologies Applied:

  • Pattern Matching (match): Used to cleanly extend the grammar to handle multiple keywords.
  • LLVM Debugging with Print Statements: Helps track how the code is processed.
  • Grammar Optimization: Simplified parameter parsing by removing unnecessary keywords.

🎯 Impact of the Change:

  • Better Grammar Flexibility: Adding a match structure allows easier expansion of the language.
  • Improved Debugging Capabilities: Debug output helps diagnose issues in LLVM-based code generation.
  • Cleaner Parameter Handling: Removing var from parameters simplifies syntax.

🔧 How to Test:

  1. Verify that new grammar keywords are correctly handled.
  2. Check if the LLVM debug prints provide meaningful insight into code generation.
  3. Confirm that parameter parsing functions correctly after removing the var keyword.
  4. Ensure the new cloning mechanism works properly for debugging.

🚀 Version Update:

  • No new version bump (refactoring and grammar updates).

@LunaStev
LunaStev merged commit 57626ff into develop Feb 19, 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