Skip to content

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