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

Generate HostRef #261

Merged
merged 8 commits into from
Nov 21, 2023
Merged

Generate HostRef #261

merged 8 commits into from
Nov 21, 2023

Conversation

kpob
Copy link
Contributor

@kpob kpob commented Nov 20, 2023

Generate test parts module with HostRef inside.
Change approach to code generation:

  • each item implements TryFrom<&*IR>
  • keep ToTokens implementation as simple as possible (derived if possible)
  • items are made of syn primitives or custom items implementing ToToken

kpob added 4 commits November 20, 2023 12:28
* add HostRefItem
* extract common part of ContractRef and HostRef
* change name `method` to `function`
* add test_wasm_parts module
* add HostRefItem
* refactor items
Copy link
Contributor

@zie1ony zie1ony left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After spending some time with the code, I really like the new approach 💯

odra-macros/src/ast/deployer_item.rs Show resolved Hide resolved
odra-macros/src/ast/host_ref_item.rs Outdated Show resolved Hide resolved
odra-macros/src/ast/host_ref_item.rs Outdated Show resolved Hide resolved
odra-macros/src/ast/parts_utils.rs Outdated Show resolved Hide resolved
odra-macros/src/ast/ref_item.rs Outdated Show resolved Hide resolved
odra-macros/src/ast/ref_item.rs Outdated Show resolved Hide resolved
odra-macros/src/ast/ref_utils.rs Show resolved Hide resolved
odra-macros/src/utils/string.rs Outdated Show resolved Hide resolved
This was linked to issues Nov 21, 2023
@kpob kpob merged commit f0b56fd into release/0.8.0 Nov 21, 2023
1 check passed
@kpob kpob deleted the feature/host-ref-macro branch November 21, 2023 10:36
kubaplas pushed a commit that referenced this pull request Nov 22, 2023
* HostRefItem
* add HostRefItem
* extract common part of ContractRef and HostRef
* change name `method` to `function`
* add test_wasm_parts module
* add HostRefItem
* refactor items
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.

try_ metods in HostRef Add odra-macros crate
2 participants