Skip to content

Commit

Permalink
Merge pull request #32 from vinhnx/master
Browse files Browse the repository at this point in the history
Add Swift language support
  • Loading branch information
o2sh authored Apr 22, 2019
2 parents 2e8d973 + 827eadb commit 8194d16
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
15 changes: 15 additions & 0 deletions resources/swift.ascii
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.+---.
:+: +++++:
..--. .-+=-. -======:
:====: ===:: =======
::===:: :====-: ========::
-=====::-=====:. ==========.
::===============: ===========
.:===============::===========
.-------------------------
-. .-----------------------
.:---::.... ..:--------------------.
..-------------------------------------------
.:::--------------------------------------::
.:::-::::::::::::::::::--.........::::
......:::::::..... :::
6 changes: 6 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ enum Language {
Rust,
Scala,
Shell,
Swift,
TypeScript,
JavaScript,
Php,
Expand All @@ -260,6 +261,7 @@ impl fmt::Display for Language {
Language::Rust => write!(f, "Rust"),
Language::Scala => write!(f, "Scala"),
Language::Shell => write!(f, "Shell"),
Language::Swift => write!(f, "Swift"),
Language::TypeScript => write!(f, "TypeScript"),
Language::JavaScript => write!(f, "JavaScript"),
Language::Php => write!(f, "Php"),
Expand Down Expand Up @@ -548,6 +550,7 @@ impl From<tokei::LanguageType> for Language {
tokei::LanguageType::Rust => Language::Rust,
tokei::LanguageType::Scala => Language::Scala,
tokei::LanguageType::Sh => Language::Shell,
tokei::LanguageType::Swift => Language::Swift,
tokei::LanguageType::TypeScript => Language::TypeScript,
tokei::LanguageType::JavaScript => Language::JavaScript,
tokei::LanguageType::Php => Language::Php,
Expand All @@ -574,6 +577,7 @@ fn get_all_language_types() -> Vec<tokei::LanguageType> {
tokei::LanguageType::Rust,
tokei::LanguageType::Scala,
tokei::LanguageType::Sh,
tokei::LanguageType::Swift,
tokei::LanguageType::TypeScript,
tokei::LanguageType::JavaScript,
tokei::LanguageType::Php,
Expand All @@ -599,6 +603,7 @@ impl Info {
Language::Rust => include_str!("../resources/rust.ascii"),
Language::Scala => include_str!("../resources/scala.ascii"),
Language::Shell => include_str!("../resources/shell.ascii"),
Language::Swift => include_str!("../resources/swift.ascii"),
Language::TypeScript => include_str!("../resources/typescript.ascii"),
Language::JavaScript => include_str!("../resources/javascript.ascii"),
Language::Php => include_str!("../resources/php.ascii"),
Expand All @@ -624,6 +629,7 @@ impl Info {
Language::Rust => vec![Color::White, Color::BrightRed],
Language::Scala => vec![Color::Blue],
Language::Shell => vec![Color::Green],
Language::Swift => vec![Color::BrightRed],
Language::TypeScript => vec![Color::Cyan],
Language::JavaScript => vec![Color::BrightYellow],
Language::Php => vec![Color::BrightWhite],
Expand Down

0 comments on commit 8194d16

Please sign in to comment.