-
-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
177: More complete #[export] implementation r=Bromeon a=ttencate Also: - Remove unused `property` argument. - Rename arguments `getter` and `setter` to `get` and `set` to stay closer to GDScript and save keystrokes. - Check at compilation time that the referenced getter and setter actually exist (otherwise Godot gives a cryptic "invalid get/set index" error). See #3. TBD: - [ ] ~~`strip_quotes` should go away, not sure if it even works correctly if using e.g. raw string literals. Use an actual Rust parser? Omit the quotes from the argument instead, i.e. `get = get_my_field` instead of `get = "get_my_field"`?~~ See discussion below. - [ ] ~~Make `KvParser::parse` take a closure so we can check that all fields have been consumed~~ See discussion below. - [x] Omitting one of getter/setter should make field write/read only - [x] Use `get`/`set` without arguments to generate a default one - [x] Make generated getters and setters `pub` since they're public to Godot anyway Co-authored-by: Thomas ten Cate <[email protected]>
- Loading branch information
Showing
6 changed files
with
374 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.