This commit is contained in:
Michael Zhang 2020-04-18 18:05:31 -05:00
commit 33cea5bc3d
Signed by: michael
GPG key ID: BDA47A31A3C8EE6B
14 changed files with 171 additions and 0 deletions

7
.editorconfig Normal file
View file

@ -0,0 +1,7 @@
[*.rs]
end_of_file = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
indent_style = space
indent_size = 4

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/target

14
Cargo.lock generated Normal file
View file

@ -0,0 +1,14 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "backend"
version = "0.1.0"
[[package]]
name = "driver"
version = "0.1.0"
[[package]]
name = "syntax"
version = "0.1.0"

6
Cargo.toml Normal file
View file

@ -0,0 +1,6 @@
[workspace]
members = [
"backend",
"syntax",
"driver",
]

9
backend/Cargo.toml Normal file
View file

@ -0,0 +1,9 @@
[package]
name = "backend"
version = "0.1.0"
authors = ["Michael Zhang <iptq@protonmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

7
backend/src/lib.rs Normal file
View file

@ -0,0 +1,7 @@
#[cfg(test)]
mod tests {
#[test]
fn it_works() {
assert_eq!(2 + 2, 4);
}
}

9
driver/Cargo.toml Normal file
View file

@ -0,0 +1,9 @@
[package]
name = "driver"
version = "0.1.0"
authors = ["Michael Zhang <iptq@protonmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

27
driver/src/main.rs Normal file
View file

@ -0,0 +1,27 @@
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
#![feature(rustc_private)]
#![feature(str_strip)]
#[allow(unused_extern_crates)]
extern crate rustc_driver;
#[allow(unused_extern_crates)]
extern crate rustc_errors;
#[allow(unused_extern_crates)]
extern crate rustc_interface;
#[allow(unused_extern_crates)]
extern crate rustc_middle;
use rustc_driver::Callbacks;
struct DefaultCallbacks;
impl Callbacks for DefaultCallbacks {}
fn main() {
rustc_driver::run_compiler(
&[String::from("rustc"), String::from("main.rs")],
&mut DefaultCallbacks,
None,
None,
)
.unwrap();
}

View file

@ -0,0 +1,9 @@
[routes]
admin = { path = "admin" }
api = [
{ path = "articles" },
{ path = "auth" },
{ path = "profiles" },
]

1
rust-toolchain Normal file
View file

@ -0,0 +1 @@
master

36
setup-toolchain.sh Executable file
View file

@ -0,0 +1,36 @@
#!/bin/bash
# Set up the appropriate rustc toolchain
set -e
cd "$(dirname "$0")"
RTIM_PATH=$(command -v rustup-toolchain-install-master) || INSTALLED=false
CARGO_HOME=${CARGO_HOME:-$HOME/.cargo}
# Check if RTIM is not installed or installed in other locations not in ~/.cargo/bin
if [[ "$INSTALLED" == false || "$RTIM_PATH" == $CARGO_HOME/bin/rustup-toolchain-install-master ]]; then
cargo +nightly install rustup-toolchain-install-master
else
VERSION=$(rustup-toolchain-install-master -V | grep -o "[0-9.]*")
REMOTE=$(cargo +nightly search rustup-toolchain-install-master | grep -o "[0-9.]*")
echo "info: skipping updating rustup-toolchain-install-master at $RTIM_PATH"
echo " current version : $VERSION"
echo " remote version : $REMOTE"
fi
RUST_COMMIT=$(git ls-remote https://github.com/rust-lang/rust master | awk '{print $1}')
if rustc +master -Vv 2>/dev/null | grep -q "$RUST_COMMIT"; then
echo "info: master toolchain is up-to-date"
exit 0
fi
if [[ -n "$HOST_TOOLCHAIN" ]]; then
TOOLCHAIN=('--host' "$HOST_TOOLCHAIN")
else
TOOLCHAIN=()
fi
rustup-toolchain-install-master -f -n master "${TOOLCHAIN[@]}" -c rustc-dev -- "$RUST_COMMIT"
rustup override set master

9
syntax/Cargo.toml Normal file
View file

@ -0,0 +1,9 @@
[package]
name = "syntax"
version = "0.1.0"
authors = ["Michael Zhang <iptq@protonmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

7
syntax/src/lib.rs Normal file
View file

@ -0,0 +1,7 @@
#[cfg(test)]
mod tests {
#[test]
fn it_works() {
assert_eq!(2 + 2, 4);
}
}

29
todomvc.ent Normal file
View file

@ -0,0 +1,29 @@
component TodoMVC {
model {
value: String,
todos: List<String>,
}
view {
InputBox [
bind:text = model.value,
on:submit (model, event) => { },
] {
}
List {
}
}
}
component Navbar {
model {
}
}
component InputBox {
}