Skip to content

Commit

Permalink
Merge pull request #47 from spenserblack/lang/kotlin
Browse files Browse the repository at this point in the history
Add Kotlin support
  • Loading branch information
o2sh authored Oct 3, 2019
2 parents 6fbad3b + aea155e commit 59c81c2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
21 changes: 21 additions & 0 deletions resources/kotlin.ascii
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

{0}KOTLIN{2}KOTLINKOTLINKO{1}TLINKOTLINKOTLINKOTL
{0}KOTLINKO{2}TLINKOTLIN{1}KOTLINKOTLINKOTLINKO
{0}KOTLINKOTL{2}INKOTL{1}INKOTLINKOTLINKOTLIN
{0}KOTLINKOTLIN{2}KO{1}TLINKOTLINKOTLINKOTL
{0}KOTLINKOTLIN{1}KOTLINKOTLINKOTLINKO
{0}KOTLINKOTL{1}INKOTLINKOTLINKOTLIN
{0}KOTLINKO{1}TLINKOTLINKOTLINKOTL
{0}KOTLIN{1}KOTLINKOTLINKOTLINKO
{0}KOTL{1}INKOTLINKOTLINKOTLIN
{0}KO{1}TLINKOTLINKOTLINKOTL
{1}KOTLINKOTLINKOTLINKO{2}TL
{2}KO{1}TLINKOTLINKOTLIN{2}KOTLIN
{2}KOTL{1}INKOTLINKOTL{2}INKOTLINKO
{2}KOTLIN{1}KOTLINKO{2}TLINKOTLINKOTL
{2}KOTLINKO{1}TLIN{0}K{2}OTLINKOTLINKOTLIN
{2}KOTLINKOTL{0}INKOT{2}LINKOTLINKOTLINKO
{2}KOTLINKO{0}TLINKOTLI{2}NKOTLINKOTLINKOTL
{2}KOTLIN{0}KOTLINKOTLINK{2}OTLINKOTLINKOTLIN
{2}KOTL{0}INKOTLINKOTLINKOT{2}LINKOTLINKOTLINKO
{2}KO{0}TLINKOTLINKOTLINKOTLI{2}NKOTLINKOTLINKOTL
6 changes: 6 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ enum Language {
Go,
Haskell,
Java,
Kotlin,
Lisp,
Lua,
Nim,
Expand Down Expand Up @@ -300,6 +301,7 @@ impl fmt::Display for Language {
Language::Go => write!(f, "Go"),
Language::Haskell => write!(f, "Haskell"),
Language::Java => write!(f, "Java"),
Language::Kotlin => write!(f, "Kotlin"),
Language::Lisp => write!(f, "Lisp"),
Language::Lua => write!(f, "Lua"),
Language::Nim => write!(f, "Nim"),
Expand Down Expand Up @@ -637,6 +639,7 @@ impl From<tokei::LanguageType> for Language {
tokei::LanguageType::Go => Language::Go,
tokei::LanguageType::Haskell => Language::Haskell,
tokei::LanguageType::Java => Language::Java,
tokei::LanguageType::Kotlin => Language::Kotlin,
tokei::LanguageType::Lisp => Language::Lisp,
tokei::LanguageType::Lua => Language::Lua,
tokei::LanguageType::Nim => Language::Nim,
Expand Down Expand Up @@ -668,6 +671,7 @@ fn get_all_language_types() -> Vec<tokei::LanguageType> {
tokei::LanguageType::Go,
tokei::LanguageType::Haskell,
tokei::LanguageType::Java,
tokei::LanguageType::Kotlin,
tokei::LanguageType::Lisp,
tokei::LanguageType::Lua,
tokei::LanguageType::Nim,
Expand Down Expand Up @@ -698,6 +702,7 @@ impl Info {
Language::Go => include_str!("../resources/go.ascii"),
Language::Haskell => include_str!("../resources/haskell.ascii"),
Language::Java => include_str!("../resources/java.ascii"),
Language::Kotlin => include_str!("../resources/kotlin.ascii"),
Language::Lisp => include_str!("../resources/lisp.ascii"),
Language::Lua => include_str!("../resources/lua.ascii"),
Language::Nim => include_str!("../resources/nim.ascii"),
Expand Down Expand Up @@ -728,6 +733,7 @@ impl Info {
Language::Go => vec![Color::White],
Language::Haskell => vec![Color::BrightBlue, Color::BrightMagenta, Color::Blue],
Language::Java => vec![Color::BrightBlue, Color::Red],
Language::Kotlin => vec![Color::Blue, Color::Yellow, Color::Magenta],
Language::Lisp => vec![Color::Yellow],
Language::Lua => vec![Color::Blue],
Language::Nim => vec![Color::Yellow, Color::BrightWhite],
Expand Down

0 comments on commit 59c81c2

Please sign in to comment.