-
Notifications
You must be signed in to change notification settings - Fork 178
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
[WIP] js! proc macro #285
[WIP] js! proc macro #285
Conversation
Thanks! So far this looks simpler than I though it will. (: A few comments:
|
1 and 2 done can do 3 when the new version works the old |
Thanks! Yep. The
then that
This will be repeated for every argument. If
if cfg!( test ) {
::stdweb::initialize();
}
let restore_point = ::stdweb::private::ArenaRestorePoint::new();
$insert_serialization_code_from_1
#[allow(unused_unsafe, unused_parens)]
let result = unsafe {
let mut result: ::stdweb::private::SerializedValue = ::std::default::Default::default();
__js_raw_asm( $js_code, (&mut result as *mut _), a1 );
result.deserialize()
};
::std::mem::drop( restore_point );
result If
So, for example, this:
will result in this:
This should (unless I've made a mistake) replicate the current |
We're finally switching to a procedural macro based @ForsakenHarmony I've based the code in that PR on yours, so thanks a lot for this! |
Sorry, I should have continued here But I'm happy if you could use it in some way |
It's no problem! Thanks again. (: |
This is just the first version, looking for feedback
included 2 examples which should obviously be removed later
in
out