Skip to content

Commit

Permalink
Merge pull request #158 from Phundrak/master
Browse files Browse the repository at this point in the history
Added support for CMake, Emacs Lisp, Fish and Nix
  • Loading branch information
o2sh authored Nov 11, 2019
2 parents 3d4e4c2 + 36fcc86 commit 7ed1c6a
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 3 deletions.
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^`
15 changes: 15 additions & 0 deletions resources/emacslisp.ascii
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{0} ':r\iv7i|r:'
{0} :LFaZZZaaaoooo2t\:
{0} ^]aZZZZaaw9DN{1}Q@Q{0}gojjv;
{0} ,vaZZZaX69KOHRW#{1}@@@{0}Ouuuu/,
{0} _[ZZaaa{1}Q@@@@QBNMRD{0}dEuuufFFl,
{0}.7aaaooo{1}wB@@#{0}h2jjuuuufFF]]]]|-
{0}:yooooSSS2S${1}gQ@Q{0}8hjfFF]]]][tz"
{0};oooSS2ed#{1}Q@@@@@Q{0}N{0}Do]]][[ttt[:
{0}:uSS2mQ{1}@@@@Q{0}deuF]]]][[ttt[[[z~
{0}-/yjjO{1}@@@@Q{0}uFF]]][[tttt[[]]]?`
{0} ,vuuue&{1}Q@@@QQ#NNggg{0}&D9u[]i'
{0} '/ffFF]]jek99OR{1}#Q@@Q{0}Hj]]|'
{0} `;c]]][uaXUKO$wo]]]]L:`
{0} `,>i1tt[[]]]]ti>,`
{0} `.~;^>??>^;,-`
15 changes: 15 additions & 0 deletions resources/fish.ascii
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{0} ___
{0} ___======____=-{1}-{0}-=)
{0}/T \_{1}--={0}==)
{0}[ \ ({1}0{0}) \~ \_{1}-={0}=)
{0} \ / )J~~ \{1}-={0})
{0} \\___/ )JJ~{1}~~{0} \)
{0} \_____/JJJ~~{1}~~{0} \
{0} / \ {1}, \{0}J~~~{1}~~{0} \
{0} (-{1}\){0}\=|{1}\\\{0}~~{1}~~{0} L_{1}_
{0} (\\) ({1}\{0}\\)_ {1}\==__
{0} \V \\\) ===_____ {1}\\\\{0}\\
{0} \V) \_) \\{1}\\JJ\{0}J\)
{0} /J{1}\J{0}T\JJJJ)
{0} (JJJ| \UUU)
{0} (UU)
12 changes: 12 additions & 0 deletions resources/nix.ascii
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{1} `kdF` `D@@j `O@Q-
{1} :qOe' 2@@DQ@@*
{1} /2yyPOKUf]}{{0}a@@@Q, ;
{1} ;\\\\akEj|||?*{0};Q@@^ `jDo
{0} J@@D- `H@@ {1}XHK:
{0}kkkEE&@@{0}2 a$OOazz1;
{0}999#@@@{0}Z> ?9qjvvvzz;
{0} ^@@Q {0}Ek{` `zk6*
{0} g@M- {1}:E9e{0};ujyy2UDDKoooo*
{0} \ {1}.eKKq{0}ZDDRR@@@QMMMo
{1} :UOXfHH/ ,Q@@>
{1} `PHj` \HDj` `H@Q-
35 changes: 32 additions & 3 deletions 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 All @@ -18,9 +19,12 @@ pub enum Language {
CSS,
D,
Dart,
#[strum(serialize = "emacslisp")]
Elisp,
Elixir,
Elm,
Erlang,
Fish,
Forth,
#[strum(serialize = "fortran")]
FortranModern,
Expand All @@ -37,10 +41,10 @@ pub enum Language {
Lua,
Markdown,
Nim,
Nix,
#[strum(serialize = "objective-c")]
ObjectiveC,
OCaml,
#[strum(serialize = "org-mode")]
Org,
Perl,
Php,
Expand Down Expand Up @@ -69,15 +73,18 @@ 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#"),
Language::CSS => write!(f, "CSS"),
Language::D => write!(f, "D"),
Language::Dart => write!(f, "Dart"),
Language::Elisp => write!(f, "EmacsLisp"),
Language::Elixir => write!(f, "Elixir"),
Language::Elm => write!(f, "Elm"),
Language::Erlang => write!(f, "Erlang"),
Language::Fish => write!(f, "Fish"),
Language::Forth => write!(f, "Forth"),
Language::FortranModern => write!(f, "Fortran"),
Language::FSharp => write!(f, "FSharp"),
Expand All @@ -93,9 +100,10 @@ impl std::fmt::Display for Language {
Language::Lua => write!(f, "Lua"),
Language::Markdown => write!(f, "Markdown"),
Language::Nim => write!(f, "Nim"),
Language::Nix => write!(f, "Nix"),
Language::ObjectiveC => write!(f, "Objective-C"),
Language::OCaml => write!(f, "OCaml"),
Language::Org => write!(f, "Org-mode"),
Language::Org => write!(f, "Org"),
Language::PureScript => write!(f, "PureScript"),
Language::Python => write!(f, "Python"),
Language::R => write!(f, "R"),
Expand Down Expand Up @@ -126,15 +134,18 @@ 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,
tokei::LanguageType::Css => Language::CSS,
tokei::LanguageType::D => Language::D,
tokei::LanguageType::Dart => Language::Dart,
tokei::LanguageType::Elisp => Language::Elisp,
tokei::LanguageType::Elixir => Language::Elixir,
tokei::LanguageType::Elm => Language::Elm,
tokei::LanguageType::Erlang => Language::Erlang,
tokei::LanguageType::Fish => Language::Fish,
tokei::LanguageType::Forth => Language::Forth,
tokei::LanguageType::FortranModern => Language::FortranModern,
tokei::LanguageType::FSharp => Language::FSharp,
Expand All @@ -150,6 +161,7 @@ impl From<tokei::LanguageType> for Language {
tokei::LanguageType::Lua => Language::Lua,
tokei::LanguageType::Markdown => Language::Markdown,
tokei::LanguageType::Nim => Language::Nim,
tokei::LanguageType::Nix => Language::Nix,
tokei::LanguageType::ObjectiveC => Language::ObjectiveC,
tokei::LanguageType::OCaml => Language::OCaml,
tokei::LanguageType::Org => Language::Org,
Expand Down Expand Up @@ -182,15 +194,18 @@ 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"),
Language::CSS => include_str!("../resources/css.ascii"),
Language::D => include_str!("../resources/d.ascii"),
Language::Dart => include_str!("../resources/dart.ascii"),
Language::Elisp => include_str!("../resources/emacslisp.ascii"),
Language::Elixir => include_str!("../resources/elixir.ascii"),
Language::Elm => include_str!("../resources/elm.ascii"),
Language::Erlang => include_str!("../resources/erlang.ascii"),
Language::Fish => include_str!("../resources/fish.ascii"),
Language::Forth => include_str!("../resources/forth.ascii"),
Language::FortranModern => include_str!("../resources/f90.ascii"),
Language::FSharp => include_str!("../resources/fsharp.ascii"),
Expand All @@ -206,6 +221,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::Nix => include_str!("../resources/nix.ascii"),
Language::ObjectiveC => include_str!("../resources/objectivec.ascii"),
Language::OCaml => include_str!("../resources/ocaml.ascii"),
Language::Org => include_str!("../resources/org.ascii"),
Expand Down Expand Up @@ -237,22 +253,30 @@ 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],
Language::CSS => vec![Color::Blue, Color::White],
Language::D => vec![Color::Red],
Language::Dart => vec![Color::BrightBlue, Color::BrightCyan],
Language::Elisp => vec![Color::BrightMagenta, Color::White],
Language::Elixir => vec![Color::Magenta],
Language::Elm => vec![Color::BrightBlack, Color::Green, Color::Yellow, Color::Cyan],
Language::Erlang => vec![Color::BrightRed],
Language::Fish => vec![Color::Red, Color::Yellow],
Language::Forth => vec![Color::BrightRed],
Language::FortranModern => vec![
Color::BrightWhite,
Color::BrightGreen,
Color::BrightBlue,
Color::BrightYellow,
Color::BrightRed
Color::BrightRed,
],
Language::FSharp => vec![Color::BrightBlue, Color::Cyan],
Language::Go => vec![Color::White],
Expand All @@ -273,6 +297,7 @@ impl Language {
Language::Lua => vec![Color::Blue],
Language::Markdown => vec![Color::BrightWhite, Color::BrightRed],
Language::Nim => vec![Color::Yellow, Color::BrightWhite],
Language::Nix => vec![Color::BrightBlue, Color::Blue],
Language::ObjectiveC => vec![Color::BrightBlue, Color::Blue],
Language::OCaml => vec![Color::Yellow],
Language::Org => vec![Color::Green, Color::Red, Color::White],
Expand Down Expand Up @@ -358,15 +383,18 @@ 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,
tokei::LanguageType::Css,
tokei::LanguageType::D,
tokei::LanguageType::Dart,
tokei::LanguageType::Elixir,
tokei::LanguageType::Elisp,
tokei::LanguageType::Elm,
tokei::LanguageType::Erlang,
tokei::LanguageType::Fish,
tokei::LanguageType::Forth,
tokei::LanguageType::FortranModern,
tokei::LanguageType::FSharp,
Expand All @@ -382,6 +410,7 @@ fn get_all_language_types() -> Vec<tokei::LanguageType> {
tokei::LanguageType::Lua,
tokei::LanguageType::Markdown,
tokei::LanguageType::Nim,
tokei::LanguageType::Nix,
tokei::LanguageType::ObjectiveC,
tokei::LanguageType::OCaml,
tokei::LanguageType::Org,
Expand Down

0 comments on commit 7ed1c6a

Please sign in to comment.