-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style: using cargo fmt for formatting
- Loading branch information
Showing
90 changed files
with
1,661 additions
and
1,433 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,21 @@ | ||
|
||
use std::env; | ||
|
||
pub fn arg_parser() -> InputType{ | ||
pub fn arg_parser() -> InputType { | ||
let args: Vec<String> = env::args().collect(); | ||
|
||
match args.get(1) { | ||
None => InputType::Repl, | ||
Some(param) => match param.as_str() { | ||
"--help" | "-h" => InputType::Help, | ||
"--version" | "-v"=> InputType::Version, | ||
file_name => { | ||
InputType::ExecuteFile(file_name.to_string()) | ||
} | ||
"--version" | "-v" => InputType::Version, | ||
file_name => InputType::ExecuteFile(file_name.to_string()), | ||
}, | ||
} | ||
} | ||
|
||
pub enum InputType{ | ||
pub enum InputType { | ||
ExecuteFile(String), | ||
Help, | ||
Repl, | ||
Version | ||
Version, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
|
||
use super::param::Param; | ||
|
||
#[derive(Debug, PartialEq, Clone)] | ||
pub enum Chunk{ | ||
pub enum Chunk { | ||
Params(Vec<Param>), | ||
Function(String), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
|
||
|
||
#[derive(Debug)] | ||
pub struct LineOfCode{ | ||
pub struct LineOfCode { | ||
pub line_number: u32, | ||
pub code: String | ||
pub code: String, | ||
} | ||
|
||
impl LineOfCode { | ||
pub fn new(line_number: u32, code: String) -> Self{ | ||
Self{line_number, code} | ||
pub fn new(line_number: u32, code: String) -> Self { | ||
Self { line_number, code } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
|
||
pub mod line_of_code; | ||
pub mod chunk; | ||
pub mod param; | ||
pub mod data_type; | ||
pub mod executable; | ||
pub mod errors; | ||
pub mod executable; | ||
pub mod help; | ||
pub mod line_of_code; | ||
pub mod param; | ||
pub mod splitter; | ||
pub mod version; | ||
pub mod splitter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
|
||
use super::data_type::DataType; | ||
|
||
#[derive(PartialEq, Debug, Clone)] | ||
pub enum Param { | ||
Tag(String), | ||
Variable(String), | ||
Value(DataType), | ||
} | ||
} |
Oops, something went wrong.