diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index e176dc0..816ed49 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,6 +4,10 @@ use error::Error; use std::io; use std::io::prelude::*; +#[macro_use] extern crate lalrpop_util; + +lalrpop_mod!(pub commandline); + pub type Result<T> = std::result::Result<T, Error>; @@ -33,7 +37,7 @@ fn repl() -> Result<()> { let input = read()?; match input { - Input::String(string) => execute(string)?, + Input::String(string) => execute(&string)?, Input::End => break, } } @@ -62,8 +66,11 @@ fn read() -> Result<Input> { } -fn execute(input: String) -> Result<()> { +fn execute(input: &str) -> Result<()> { + let filename = commandline::FilenameParser::new().parse(input)?; + println!("{}", input); + println!("filename '{}'", filename); Ok(()) } |