From ffd34f6fdf7573a55c798bf26c41d8ad859856d0 Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Fri, 10 Jan 2020 01:26:38 -0600 Subject: [PATCH] wtf --- .gitignore | 2 ++ Cargo.lock | 46 ++++++++++++++++++++++++++++++++++++ Cargo.toml | 10 ++++++++ enterprise-macros/Cargo.toml | 11 +++++++++ enterprise-macros/src/lib.rs | 11 +++++++++ src/backend.rs | 11 +++++++++ src/lib.rs | 0 src/widgets/mod.rs | 3 +++ todomvc/Cargo.toml | 9 +++++++ todomvc/src/main.rs | 28 ++++++++++++++++++++++ 10 files changed, 131 insertions(+) create mode 100644 .gitignore create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 enterprise-macros/Cargo.toml create mode 100644 enterprise-macros/src/lib.rs create mode 100644 src/backend.rs create mode 100644 src/lib.rs create mode 100644 src/widgets/mod.rs create mode 100644 todomvc/Cargo.toml create mode 100644 todomvc/src/main.rs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..53eaa21 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/target +**/*.rs.bk diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..28d6e3e --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,46 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "enterprise" +version = "0.1.0" + +[[package]] +name = "enterprise-macros" +version = "0.1.0" +dependencies = [ + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "proc-macro2" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "quote" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "todomvc" +version = "0.1.0" +dependencies = [ + "enterprise 0.1.0", + "enterprise-macros 0.1.0", +] + +[[package]] +name = "unicode-xid" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[metadata] +"checksum proc-macro2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0319972dcae462681daf4da1adeeaa066e3ebd29c69be96c6abb1259d2ee2bcc" +"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" +"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..b9679e8 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "enterprise" +version = "0.1.0" +authors = ["Michael Zhang "] +edition = "2018" + +[workspace] +members = ["enterprise-macros", "todomvc"] + +[dependencies] diff --git a/enterprise-macros/Cargo.toml b/enterprise-macros/Cargo.toml new file mode 100644 index 0000000..2adde7c --- /dev/null +++ b/enterprise-macros/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "enterprise-macros" +version = "0.1.0" +authors = ["Michael Zhang "] +edition = "2018" + +[lib] +proc-macro = true + +[dependencies] +quote = "1.0.2" diff --git a/enterprise-macros/src/lib.rs b/enterprise-macros/src/lib.rs new file mode 100644 index 0000000..7cd84d3 --- /dev/null +++ b/enterprise-macros/src/lib.rs @@ -0,0 +1,11 @@ +extern crate proc_macro; + +use quote::quote; +use proc_macro::TokenStream; + +#[proc_macro] +pub fn component(input_tokens: TokenStream) -> TokenStream { + let tokens = quote! { + }; + tokens.into() +} \ No newline at end of file diff --git a/src/backend.rs b/src/backend.rs new file mode 100644 index 0000000..0c33054 --- /dev/null +++ b/src/backend.rs @@ -0,0 +1,11 @@ +pub trait Backend { + +} + +pub struct WebBackend { + +} + +impl Backend for WebBackend { + +} \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/widgets/mod.rs b/src/widgets/mod.rs new file mode 100644 index 0000000..d81dbc6 --- /dev/null +++ b/src/widgets/mod.rs @@ -0,0 +1,3 @@ +pub trait Widget { + +} \ No newline at end of file diff --git a/todomvc/Cargo.toml b/todomvc/Cargo.toml new file mode 100644 index 0000000..3ef4f5c --- /dev/null +++ b/todomvc/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "todomvc" +version = "0.1.0" +authors = ["Michael Zhang "] +edition = "2018" + +[dependencies] +enterprise = { path = ".." } +enterprise-macros = { path = "../enterprise-macros" } \ No newline at end of file diff --git a/todomvc/src/main.rs b/todomvc/src/main.rs new file mode 100644 index 0000000..723e724 --- /dev/null +++ b/todomvc/src/main.rs @@ -0,0 +1,28 @@ +use enterprise_macros::component; + +component! { + data { + + } + + markup { +
+

Todos

+ +
+ + {#if items.length > 0} +
+ + {#for item in items} + {/for} + +
+ {/if} + } +} + +fn main() { + println!("Hello, world!"); +}