Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Rust ERB Templates to SplashKit Translator #19

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

NoahJCross
Copy link

@NoahJCross NoahJCross commented Dec 18, 2024

File Structure Added

res/translators/rust/
├── splashkit.rs.erb
└── implementation/
    ├── types.rs.erb
    ├── mappers.rs.erb
    ├── functions.rs.erb
    ├── types/
    │   ├── enum.rs.erb
    │   ├── struct.rs.erb
    │   ├── function_pointer.rs.erb
    │   ├── callback.rs.erb
    │   ├── typealias_pointer.rs.erb
    │   └── functions.rs.erb
    └── mappers/
        ├── bool.rs.erb
        ├── char.rs.erb
        ├── direct.rs.erb
        ├── enum.rs.erb
        ├── struct.rs.erb
        ├── vector.rs.erb
        ├── string.rs.erb
        ├── function_pointer.rs.erb
        └── typealias_pointer.rs.erb

Description

This PR adds the ERB templates required for Rust code generation in the SplashKit translator.

Implementation Details

  • Main template (splashkit.rs.erb) includes all implementation components
  • Complete type system implementation with Rust FFI bindings
  • Full mapper system for type conversions between SplashKit and Rust
  • Callback handling with thread-safe wrappers
  • Complete struct and enum implementations with proper memory management

Template Features

  • Follows Rust naming conventions (snake_case for functions, variables, fields)
  • Memory safety with reference handling
  • Consistent with existing type mappings in rust.rb
  • Maintains SplashKit function naming patterns with suffixes

Testing

  • Verified against existing translator implementation
  • Tested type conversions and FFI boundaries

Related pull request:

splashkit/skm#66

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