Skip to content

Commit

Permalink
Added CMake support
Browse files Browse the repository at this point in the history
  • Loading branch information
Phundrak committed Nov 10, 2019
1 parent 029cc0c commit 7c58540
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
13 changes: 13 additions & 0 deletions resources/cmake.ascii
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{0} ;e{2}`
{0} ;QD{2}?`
{0} ;B#R{2}1r`
{0} ;WRMK{2}S|r`
{0} :O9KOK{2}S\\*`
{0} :keXPk6{2}Zc7v|`
{0} :ajyoaZe{3}m{2}JJ{]\`
{0} :]z1x}f9{3}@@{2}yujSoc`
{0} "7\/LvU{3}Q@@@{2}XoZemXv`
{0} ,\**v{1}oo{3}qMBBB{2}kmXEkU9z`
{0} ,\*}{1}Sx\||?|cFf{2}okqOdHDx`
{0} ,L]{1}jc\\\||?*>rr^^|zo{2}$MN]`
{0}-v{1}7????*>>rrr^^^;;;;;;^\{2}F^`
8 changes: 7 additions & 1 deletion src/language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pub enum Language {
Assembly,
C,
Clojure,
CMake,
CoffeeScript,
#[strum(serialize = "c++")]
Cpp,
Expand Down Expand Up @@ -71,6 +72,7 @@ impl std::fmt::Display for Language {
Language::Assembly => write!(f, "Assembly"),
Language::C => write!(f, "C"),
Language::Clojure => write!(f, "Clojure"),
Language::CMake => write!(f, "CMake"),
Language::CoffeeScript => write!(f, "CoffeeScript"),
Language::Cpp => write!(f, "C++"),
Language::Csharp => write!(f, "C#"),
Expand Down Expand Up @@ -130,6 +132,7 @@ impl From<tokei::LanguageType> for Language {
tokei::LanguageType::Assembly => Language::Assembly,
tokei::LanguageType::C => Language::C,
tokei::LanguageType::Clojure => Language::Clojure,
tokei::LanguageType::CMake => Language::CMake,
tokei::LanguageType::CoffeeScript => Language::CoffeeScript,
tokei::LanguageType::Cpp => Language::Cpp,
tokei::LanguageType::CSharp => Language::Csharp,
Expand Down Expand Up @@ -188,6 +191,7 @@ impl Language {
Language::Assembly => include_str!("../resources/assembly.ascii"),
Language::C => include_str!("../resources/c.ascii"),
Language::Clojure => include_str!("../resources/clojure.ascii"),
Language::CMake => include_str!("../resources/cmake.ascii"),
Language::CoffeeScript => include_str!("../resources/coffeescript.ascii"),
Language::Cpp => include_str!("../resources/cpp.ascii"),
Language::Csharp => include_str!("../resources/csharp.ascii"),
Expand Down Expand Up @@ -245,6 +249,7 @@ impl Language {
Language::Assembly => vec![Color::Cyan],
Language::C => vec![Color::BrightBlue, Color::Blue],
Language::Clojure => vec![Color::BrightBlue, Color::BrightGreen],
Language::CMake => vec![Color::Blue, Color::BrightGreen, Color::Red, Color::BrightBlack],
Language::CoffeeScript => vec![Color::Red],
Language::Cpp => vec![Color::Yellow, Color::Cyan],
Language::Csharp => vec![Color::White],
Expand All @@ -262,7 +267,7 @@ impl Language {
Color::BrightGreen,
Color::BrightBlue,
Color::BrightYellow,
Color::BrightRed
Color::BrightRed,
],
Language::FSharp => vec![Color::BrightBlue, Color::Cyan],
Language::Go => vec![Color::White],
Expand Down Expand Up @@ -368,6 +373,7 @@ fn get_all_language_types() -> Vec<tokei::LanguageType> {
tokei::LanguageType::Assembly,
tokei::LanguageType::C,
tokei::LanguageType::Clojure,
tokei::LanguageType::CMake,
tokei::LanguageType::CoffeeScript,
tokei::LanguageType::Cpp,
tokei::LanguageType::CSharp,
Expand Down

0 comments on commit 7c58540

Please sign in to comment.