Skip to content

Commit

Permalink
Added new extension
Browse files Browse the repository at this point in the history
fix: only `.ved` file extension are allowed.  (#27)

* fix: only .ved file is allowed

Signed-off-by: Kunal Singh <[email protected]>

* fix: unnecessory remove .deref() on bool

---------

Signed-off-by: Kunal Singh <[email protected]>
  • Loading branch information
KunalSin9h authored Oct 18, 2023
1 parent 810df98 commit bc104d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions cli/src/utilities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
",
Expand Down Expand Up @@ -60,7 +60,7 @@ pub fn run(args: Vec<String>) {
}

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) {
Expand All @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/mulya.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl fmt::Display for Mulya {
write!(
f,
"{}",
if *mulya.deref() {
if *mulya {
"सत्य"
} else {
"असत्य"
Expand Down

0 comments on commit bc104d8

Please sign in to comment.