-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds FFI macro to generate a yaml file for each class
- Loading branch information
Showing
9 changed files
with
255 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[env] | ||
CARGO_WORKSPACE_DIR = { value = "", relative = true } |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,6 @@ target/ | |
|
||
# These are backup files generated by rustfmt | ||
**/*.rs.bk | ||
|
||
# Generated by tw_macros | ||
bindings/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ members = [ | |
"tw_evm", | ||
"tw_hash", | ||
"tw_keypair", | ||
"tw_macros", | ||
"tw_memory", | ||
"tw_misc", | ||
"tw_number", | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[package] | ||
name = "tw_macros" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[lib] | ||
proc-macro = true | ||
|
||
[dependencies] | ||
derive-syn-parse = "0.2.0" | ||
proc-macro2 = "1.0.93" | ||
quote = "1.0.38" | ||
serde = { version = "1.0", features = ["derive"] } | ||
serde_yaml = "0.9.21" | ||
syn = { version = "2.0.96", features = ["full"] } |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use proc_macro::TokenStream; | ||
|
||
mod tw_ffi; | ||
|
||
#[proc_macro_attribute] | ||
pub fn tw_ffi(attr: TokenStream, item: TokenStream) -> TokenStream { | ||
match tw_ffi::tw_ffi(attr.into(), item.into()) { | ||
Ok(item) => item.into(), | ||
Err(e) => e.to_compile_error().into(), | ||
} | ||
} | ||
|
Oops, something went wrong.