Skip to content

Commit

Permalink
Merge pull request o2sh#150 from KasraF/ocaml_support
Browse files Browse the repository at this point in the history
Added support for the OCaml language
  • Loading branch information
o2sh authored Nov 5, 2019
2 parents a133771 + 3ba0020 commit e44d736
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
19 changes: 19 additions & 0 deletions resources/ocaml.ascii
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{0} ///////////////////////////////////.
{0}///////////////////////////////////////
{0}///////////////////////////////////////
{0}///////////////////////////////////////
{0}///////////////////////////////////////
{0}/// \//// ////////////////////////
{0}// // ///////// .////////
{0}/ /////// \/////
{0} ///// //////////
{0} ///////////
{0} ////////////
{0} // ///////////////
{0} ///////// /// ////////////////////
{0}///////// ////// ////////////////////
{0}//////// //////// ///////////////////
{0}//////// ///////// ///////////////////
{0}/////// /////////// //////////////////
{0}
{0}
14 changes: 10 additions & 4 deletions src/language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ pub enum Language {
Nim,
#[strum(serialize = "objective-c")]
ObjectiveC,
OCaml,
Perl,
Php,
Prolog,
Expand Down Expand Up @@ -89,8 +90,9 @@ impl std::fmt::Display for Language {
Language::Lisp => write!(f, "Lisp"),
Language::Lua => write!(f, "Lua"),
Language::Markdown => write!(f, "Markdown"),
Language::Nim => write!(f, "Nim"),
Language::Nim => write!(f, "Nim"),
Language::ObjectiveC => write!(f, "Objective-C"),
Language::OCaml => write!(f, "OCaml"),
Language::PureScript => write!(f, "PureScript"),
Language::Python => write!(f, "Python"),
Language::R => write!(f, "R"),
Expand Down Expand Up @@ -144,8 +146,9 @@ impl From<tokei::LanguageType> for Language {
tokei::LanguageType::Lisp => Language::Lisp,
tokei::LanguageType::Lua => Language::Lua,
tokei::LanguageType::Markdown => Language::Markdown,
tokei::LanguageType::Nim => Language::Nim,
tokei::LanguageType::Nim => Language::Nim,
tokei::LanguageType::ObjectiveC => Language::ObjectiveC,
tokei::LanguageType::OCaml => Language::OCaml,
tokei::LanguageType::Prolog => Language::Prolog,
tokei::LanguageType::Perl => Language::Perl,
tokei::LanguageType::Php => Language::Php,
Expand Down Expand Up @@ -198,8 +201,9 @@ impl Language {
Language::Lisp => include_str!("../resources/lisp.ascii"),
Language::Lua => include_str!("../resources/lua.ascii"),
Language::Markdown => include_str!("../resources/markdown.ascii"),
Language::Nim => include_str!("../resources/nim.ascii"),
Language::Nim => include_str!("../resources/nim.ascii"),
Language::ObjectiveC => include_str!("../resources/objectivec.ascii"),
Language::OCaml => include_str!("../resources/ocaml.ascii"),
Language::Perl => include_str!("../resources/perl.ascii"),
Language::Php => include_str!("../resources/php.ascii"),
Language::Prolog => include_str!("../resources/prolog.ascii"),
Expand Down Expand Up @@ -263,8 +267,9 @@ impl Language {
Language::Lisp => vec![Color::Yellow],
Language::Lua => vec![Color::Blue],
Language::Markdown => vec![Color::BrightWhite, Color::BrightRed],
Language::Nim => vec![Color::Yellow, Color::BrightWhite],
Language::Nim => vec![Color::Yellow, Color::BrightWhite],
Language::ObjectiveC => vec![Color::BrightBlue, Color::Blue],
Language::OCaml => vec![Color::Yellow],
Language::Perl => vec![Color::BrightBlue],
Language::Php => vec![Color::BrightWhite],
Language::Prolog => vec![Color::Blue, Color::Red],
Expand Down Expand Up @@ -372,6 +377,7 @@ fn get_all_language_types() -> Vec<tokei::LanguageType> {
tokei::LanguageType::Markdown,
tokei::LanguageType::Nim,
tokei::LanguageType::ObjectiveC,
tokei::LanguageType::OCaml,
tokei::LanguageType::Perl,
tokei::LanguageType::Php,
tokei::LanguageType::Prolog,
Expand Down

0 comments on commit e44d736

Please sign in to comment.