diff options
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index d5cb465..7909eb9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,7 @@ use std::path::{Path, PathBuf}; use tihdy::run_file; +use tihdy::vm::Value; struct Args { file: Option<PathBuf>, @@ -10,7 +11,7 @@ struct Args { fn main() { let args = parse_args(); let file = args.file.unwrap_or_else(|| Path::new("tests/simple.tdy").to_owned()); - if let Err(errs) = run_file(&file, args.print) { + if let Err(errs) = run_file(&file, args.print, vec![(String::from("hello"), hello)]) { for err in errs.iter() { println!("{}", err); } @@ -36,3 +37,8 @@ fn parse_args() -> Args { }; args } + +pub fn hello(_parameters: &[Value]) -> Value { + println!("Hello World!"); + Value::Nil +} |
