From bc104d81759fb56e26f4d968aa087936ce37056c Mon Sep 17 00:00:00 2001 From: Kunal Singh Date: Wed, 18 Oct 2023 13:43:53 +0530 Subject: [PATCH] Added new extension fix: only `.ved` file extension are allowed. (#27) * fix: only .ved file is allowed Signed-off-by: Kunal Singh * fix: unnecessory remove .deref() on bool --------- Signed-off-by: Kunal Singh --- cli/src/utilities.rs | 16 ++++++++-------- core/src/mulya.rs | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cli/src/utilities.rs b/cli/src/utilities.rs index 685fec6..1ab0f25 100755 --- a/cli/src/utilities.rs +++ b/cli/src/utilities.rs @@ -13,20 +13,20 @@ pub fn help() { Vedic v{} Vedic is a programming language that is designed to be easy to learn and use. - + Developed by: Pt. Prashant Tripathi - + Usage: vedic [--option] [path/to/script.ved] - + Options: -h, --help Show this vedic cli help message -v, --version Print version number -r, --repl Run the vedic repl - - Examples: + + Examples: ➤ to run a vedic script vedic script.ved - + ➤ to start the vedic repl vedic -r ", @@ -60,7 +60,7 @@ pub fn run(args: Vec) { } pub fn run_file(path: &str) { - if path.ends_with(".ved") { + if path.ends_with(".ved") || path.ends_with(".veda") || path.ends_with(".vedic") { let mut aadhaar = Aadhaar::new(); aadhaar.prarambha(); let sc = match Sourcecode::new(path) { @@ -78,7 +78,7 @@ pub fn run_file(path: &str) { } } } else { - eprintln!("Invalid file extension. Only .ved files are allowed."); + eprintln!("Invalid file extension. Only .ved / .veda / .vedic extension are allowed."); process::exit(0); } } diff --git a/core/src/mulya.rs b/core/src/mulya.rs index f145873..7d32823 100755 --- a/core/src/mulya.rs +++ b/core/src/mulya.rs @@ -64,7 +64,7 @@ impl fmt::Display for Mulya { write!( f, "{}", - if *mulya.deref() { + if *mulya { "सत्य" } else { "असत्य"