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

Extend safe name filter to support Godot 3.4 API #812

Merged
merged 1 commit into from
Nov 8, 2021

Conversation

mivort
Copy link
Contributor

@mivort mivort commented Nov 6, 2021

This PR adds 'enum' keyword to rust_safe_name filter and also makes use of this filter for rusty_method_name variable in bindings generator. It allows to build godot-rust with latest stable Godot 3.4 API.

A bit of context: when trying to build bindings for latest stable Godot API, the following errors are produced:

error: expected expression, found keyword `enum`
1972 | ..., self . this . sys () . as_ptr () , class . into () , enum . into () , no_inheritance) ; StringArray :: from_sys (ret) } } # [doc = "...
     |                                                           ^^^^ expected expression

error: expected identifier, found keyword `type`
2302 | ... } # [doc = ""] # [doc = ""] # [inline] pub fn type (& self) -> GodotString { unsafe { let method_bind : * mut sys :: godot_method_bin...
     |                                                   ^^^^ expected identifier, found keyword

It seems that newer API version introduces more keyword collisions which this patch aims to fix.

This PR adds 'enum' keyword to rust_safe_name filter and also makes use
of this filter for rusty_method_name variable in bindings generator. It
allows to build godot-rust with latest stable Godot 3.4 API.
@Bromeon Bromeon added bug c: bindings Component: GDNative bindings (mod api) labels Nov 8, 2021
@Bromeon Bromeon added this to the v0.10 milestone Nov 8, 2021
@Bromeon
Copy link
Member

Bromeon commented Nov 8, 2021

Thank you! Tried it locally, this solves the issue.
There are possibly more steps we need to take for Godot 3.4 compatibility, but they can be handled separately: #814

bors r+

@bors
Copy link
Contributor

bors bot commented Nov 8, 2021

Build succeeded:

@bors bors bot merged commit 06110f9 into godot-rust:master Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug c: bindings Component: GDNative bindings (mod api)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants