Skip to content

Commit

Permalink
Move config version
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamRagstad committed Oct 28, 2024
1 parent e2fb4fc commit 584fe70
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/args.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use chrono;
use chrono::Datelike;
use clap::{arg, Command};
use colorful::{Color, Colorful};

use crate::conf::CLI_VERSION;
use lento_core::conf::LANG_VERSION;
use lento_core::LANG_VERSION;

use crate::CLI_VERSION;

const MASCOT: &str = r#"
_...---..._
Expand Down
8 changes: 4 additions & 4 deletions src/commands/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use crate::error::{print_error, print_error_usage};
/**
* Check that all input files exists.
* If the first file doesn't have a file extension and also does not exist, throw an error for invalid subcommand.
* Will exit the program if any error occured.
* Will exit the program if any error occurred.
*/
fn validate_files(files: &Vec<&Path>, arg_parser: &mut Command) {
let mut is_first = true;
Expand Down Expand Up @@ -72,14 +72,14 @@ fn parse_files<'a>(files: &Vec<&'a Path>) -> Vec<(&'a Path, Module)> {
})
.collect();
if results.len() < files.len() {
print_error("One or more errors occured during parsing!".to_string());
print_error("One or more errors occurred during parsing!".to_string());
exit(1);
}
results
}

/**
* Interpret all files in order and exit the program if any runtime error occured.
* Interpret all files in order and exit the program if any runtime error occurred.
*/
fn interpret_parse_results(parse_results: Vec<(&Path, Module)>) -> Failable<Vec<RuntimeError>> {
// Interpret all files in order. Unwrap is safe because we already checked for errors in the parse_results function
Expand All @@ -102,7 +102,7 @@ fn interpret_parse_results(parse_results: Vec<(&Path, Module)>) -> Failable<Vec<
}
if !errors.is_empty() {
errors.push(runtime_error(
"One or more errors occured during interpretation!".to_string(),
"One or more errors occurred during interpretation!".to_string(),
));
return Err(errors);
}
Expand Down
1 change: 0 additions & 1 deletion src/conf.rs

This file was deleted.

3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
mod args;
mod commands;
mod conf;
mod error;

use std::process::exit;
Expand All @@ -10,6 +9,8 @@ use args::{lento_args, lento_command};
use commands::{eval::handle_command_eval, files::handle_command_files, repl::handle_command_repl};
use error::print_error_usage;

pub const CLI_VERSION: &str = env!("CARGO_PKG_VERSION");

fn main() {
let mut arg_parser = lento_args();
let args = arg_parser.get_matches_mut();
Expand Down

0 comments on commit 584fe70

Please sign in to comment.