Trying webapp
Note this doesn't work yet
This commit is contained in:
parent
e3b236a15d
commit
006fd7d411
@ -16,4 +16,6 @@ colored = "1.5"
|
|||||||
serde = "1.0.15"
|
serde = "1.0.15"
|
||||||
serde_derive = "1.0.15"
|
serde_derive = "1.0.15"
|
||||||
serde_json = "1.0.3"
|
serde_json = "1.0.3"
|
||||||
|
rocket = "*"
|
||||||
|
rocket_codegen = "*"
|
||||||
|
|
||||||
|
@ -58,3 +58,7 @@ http://journal.stuffwithstuff.com/2011/03/19/pratt-parsers-expression-parsing-ma
|
|||||||
|
|
||||||
### LLVM
|
### LLVM
|
||||||
http://blog.ulysse.io/2016/07/03/llvm-getting-started.html
|
http://blog.ulysse.io/2016/07/03/llvm-getting-started.html
|
||||||
|
|
||||||
|
###Rust resources
|
||||||
|
https://thefullsnack.com/en/rust-for-the-web.html
|
||||||
|
https://rocket.rs/guide/getting-started/
|
||||||
|
10
src/main.rs
10
src/main.rs
@ -24,6 +24,8 @@ mod robo_lang;
|
|||||||
mod language;
|
mod language;
|
||||||
use language::{ProgrammingLanguageInterface, EvalOptions, LLVMCodeString};
|
use language::{ProgrammingLanguageInterface, EvalOptions, LLVMCodeString};
|
||||||
|
|
||||||
|
mod webapp;
|
||||||
|
|
||||||
mod llvm_wrap;
|
mod llvm_wrap;
|
||||||
|
|
||||||
mod virtual_machine;
|
mod virtual_machine;
|
||||||
@ -69,6 +71,11 @@ fn main() {
|
|||||||
std::process::exit(0);
|
std::process::exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if option_matches.opt_present("w") {
|
||||||
|
webapp::web_main();
|
||||||
|
std::process::exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
let language_names: Vec<String> = languages.iter().map(|lang| {lang.get_language_name()}).collect();
|
let language_names: Vec<String> = languages.iter().map(|lang| {lang.get_language_name()}).collect();
|
||||||
let initial_index: usize =
|
let initial_index: usize =
|
||||||
option_matches.opt_str("l")
|
option_matches.opt_str("l")
|
||||||
@ -361,6 +368,9 @@ fn program_options() -> getopts::Options {
|
|||||||
options.optflag("a",
|
options.optflag("a",
|
||||||
"assembler",
|
"assembler",
|
||||||
"Assemble file into bytecode");
|
"Assemble file into bytecode");
|
||||||
|
options.optflag("w",
|
||||||
|
"webapp",
|
||||||
|
"Start up web interpreter");
|
||||||
options
|
options
|
||||||
}
|
}
|
||||||
|
|
||||||
|
8
src/webapp.rs
Normal file
8
src/webapp.rs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#[get("/")]
|
||||||
|
fn index() -> &'static str {
|
||||||
|
"rocket test"
|
||||||
|
}
|
||||||
|
|
||||||
|
fn web_main() {
|
||||||
|
rocket::ignite().mount("/", routes![index]).launch();
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user