initial commit

This commit is contained in:
Jake Hillion 2022-02-27 18:24:23 +00:00
commit b96e840a3f
6 changed files with 48 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/target
Cargo.lock

3
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"editor.formatOnSave": true
}

11
Cargo.toml Normal file
View File

@ -0,0 +1,11 @@
[package]
name = "multi-entrypoint"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
proc-macro = true
[dependencies]

8
LICENSE Normal file
View File

@ -0,0 +1,8 @@
Copyright 2022 Jake Hillion
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# multi-entrypoint-rs
Support library for multi-entrypoint applications written in Rust.

21
src/lib.rs Normal file
View File

@ -0,0 +1,21 @@
use proc_macro::TokenStream;
#[proc_macro_attribute]
pub fn multi_entry_main(attr: TokenStream, item: TokenStream) -> TokenStream {
println!("multi_entry_main");
println!("attr: \"{}\"", attr.to_string());
println!("item: \"{}\"", item.to_string());
item
}
#[proc_macro_attribute]
pub fn entrypoint(attr: TokenStream, item: TokenStream) -> TokenStream {
println!("entrypoint");
println!("attr: \"{}\"", attr.to_string());
println!("item: \"{}\"", item.to_string());
item
}