From 77febb2c4eb623250f5d4de439a4beb295a454c9 Mon Sep 17 00:00:00 2001 From: Kasra Ferdowsifard Date: Mon, 4 Nov 2019 17:07:04 -0800 Subject: [PATCH 1/2] Added support for the OCaml language --- resources/ocaml.ascii | 19 +++++++++++++++++++ src/language.rs | 6 ++++++ 2 files changed, 25 insertions(+) create mode 100644 resources/ocaml.ascii diff --git a/resources/ocaml.ascii b/resources/ocaml.ascii new file mode 100644 index 000000000..704e23259 --- /dev/null +++ b/resources/ocaml.ascii @@ -0,0 +1,19 @@ +{0} ///////////////////////////////////. +{0}/////////////////////////////////////// +{0}/////////////////////////////////////// +{0}/////////////////////////////////////// +{0}/////////////////////////////////////// +{0}/// \//// //////////////////////// +{0}// // ///////// .//////// +{0}/ /////// \///// +{0} ///// ////////// +{0} /////////// +{0} //////////// +{0} // /////////////// +{0} ///////// /// //////////////////// +{0}///////// ////// //////////////////// +{0}//////// //////// /////////////////// +{0}//////// ///////// /////////////////// +{0}/////// /////////// ////////////////// +{0} +{0} \ No newline at end of file diff --git a/src/language.rs b/src/language.rs index 5ef2983fb..463bb2e48 100644 --- a/src/language.rs +++ b/src/language.rs @@ -34,6 +34,7 @@ pub enum Language { Lua, Markdown, Nim, + OCaml, ObjectiveC, Perl, Php, @@ -86,6 +87,7 @@ impl std::fmt::Display for Language { Language::Lua => write!(f, "Lua"), Language::Markdown => write!(f, "Markdown"), Language::Nim => write!(f, "Nim"), + Language::OCaml => write!(f, "OCaml"), Language::ObjectiveC => write!(f, "Objective-C"), Language::PureScript => write!(f, "PureScript"), Language::Python => write!(f, "Python"), @@ -141,6 +143,7 @@ impl From for Language { tokei::LanguageType::Lua => Language::Lua, tokei::LanguageType::Markdown => Language::Markdown, tokei::LanguageType::Nim => Language::Nim, + tokei::LanguageType::OCaml => Language::OCaml, tokei::LanguageType::ObjectiveC => Language::ObjectiveC, tokei::LanguageType::Prolog => Language::Prolog, tokei::LanguageType::Perl => Language::Perl, @@ -195,6 +198,7 @@ impl Language { Language::Lua => include_str!("../resources/lua.ascii"), Language::Markdown => include_str!("../resources/markdown.ascii"), Language::Nim => include_str!("../resources/nim.ascii"), + Language::OCaml => include_str!("../resources/ocaml.ascii"), Language::ObjectiveC => include_str!("../resources/objectivec.ascii"), Language::Perl => include_str!("../resources/perl.ascii"), Language::Php => include_str!("../resources/php.ascii"), @@ -260,6 +264,7 @@ impl Language { Language::Lua => vec![Color::Blue], Language::Markdown => vec![Color::BrightWhite, Color::BrightRed], Language::Nim => vec![Color::Yellow, Color::BrightWhite], + Language::OCaml => vec![Color::Yellow], Language::ObjectiveC => vec![Color::BrightBlue, Color::Blue], Language::Perl => vec![Color::BrightBlue], Language::Php => vec![Color::BrightWhite], @@ -367,6 +372,7 @@ fn get_all_language_types() -> Vec { tokei::LanguageType::Lua, tokei::LanguageType::Markdown, tokei::LanguageType::Nim, + tokei::LanguageType::OCaml, tokei::LanguageType::ObjectiveC, tokei::LanguageType::Perl, tokei::LanguageType::Php, From 790962244fb96584f8421a8d5341dfb3f8fedaa1 Mon Sep 17 00:00:00 2001 From: Kasra Ferdowsifard Date: Mon, 4 Nov 2019 17:10:19 -0800 Subject: [PATCH 2/2] fixed whitespace --- src/language.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/language.rs b/src/language.rs index 463bb2e48..585548183 100644 --- a/src/language.rs +++ b/src/language.rs @@ -34,7 +34,7 @@ pub enum Language { Lua, Markdown, Nim, - OCaml, + OCaml, ObjectiveC, Perl, Php, @@ -87,7 +87,7 @@ impl std::fmt::Display for Language { Language::Lua => write!(f, "Lua"), Language::Markdown => write!(f, "Markdown"), Language::Nim => write!(f, "Nim"), - Language::OCaml => write!(f, "OCaml"), + Language::OCaml => write!(f, "OCaml"), Language::ObjectiveC => write!(f, "Objective-C"), Language::PureScript => write!(f, "PureScript"), Language::Python => write!(f, "Python"), @@ -143,7 +143,7 @@ impl From for Language { tokei::LanguageType::Lua => Language::Lua, tokei::LanguageType::Markdown => Language::Markdown, tokei::LanguageType::Nim => Language::Nim, - tokei::LanguageType::OCaml => Language::OCaml, + tokei::LanguageType::OCaml => Language::OCaml, tokei::LanguageType::ObjectiveC => Language::ObjectiveC, tokei::LanguageType::Prolog => Language::Prolog, tokei::LanguageType::Perl => Language::Perl, @@ -198,7 +198,7 @@ impl Language { Language::Lua => include_str!("../resources/lua.ascii"), Language::Markdown => include_str!("../resources/markdown.ascii"), Language::Nim => include_str!("../resources/nim.ascii"), - Language::OCaml => include_str!("../resources/ocaml.ascii"), + Language::OCaml => include_str!("../resources/ocaml.ascii"), Language::ObjectiveC => include_str!("../resources/objectivec.ascii"), Language::Perl => include_str!("../resources/perl.ascii"), Language::Php => include_str!("../resources/php.ascii"), @@ -264,7 +264,7 @@ impl Language { Language::Lua => vec![Color::Blue], Language::Markdown => vec![Color::BrightWhite, Color::BrightRed], Language::Nim => vec![Color::Yellow, Color::BrightWhite], - Language::OCaml => vec![Color::Yellow], + Language::OCaml => vec![Color::Yellow], Language::ObjectiveC => vec![Color::BrightBlue, Color::Blue], Language::Perl => vec![Color::BrightBlue], Language::Php => vec![Color::BrightWhite], @@ -372,7 +372,7 @@ fn get_all_language_types() -> Vec { tokei::LanguageType::Lua, tokei::LanguageType::Markdown, tokei::LanguageType::Nim, - tokei::LanguageType::OCaml, + tokei::LanguageType::OCaml, tokei::LanguageType::ObjectiveC, tokei::LanguageType::Perl, tokei::LanguageType::Php,