Skip to content

Commit

Permalink
added support for Perl #39
Browse files Browse the repository at this point in the history
  • Loading branch information
o2sh committed Jul 14, 2019
1 parent 26515eb commit 1dd1169
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
22 changes: 22 additions & 0 deletions resources/perl.ascii
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{0} ######
{0} ### #########
{0} ######## ##########
{0} ######### ############
{0} ###### ###############
{0} ####### ##################
{0} ####### ###################
{0} ############################
{0} #############################
{0} ########################### ##
{0} ######################### ##
{0} ################### ### #
{0} ##### #### ### ### #
{0} #### #### ### ##
{0} #### ### ### #
{0} ## ### ### #
{0} ## ## ## #
{0} ## # # #
{0} # ## #
{0} # # # #
{0} # ### ## ##
{0} ##
6 changes: 6 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ enum Language {
Swift,
TypeScript,
JavaScript,
Perl,
Php,
}

Expand Down Expand Up @@ -270,6 +271,7 @@ impl fmt::Display for Language {
Language::Swift => write!(f, "Swift"),
Language::TypeScript => write!(f, "TypeScript"),
Language::JavaScript => write!(f, "JavaScript"),
Language::Perl => write!(f, "Perl"),
Language::Php => write!(f, "Php"),
}
}
Expand Down Expand Up @@ -562,6 +564,7 @@ impl From<tokei::LanguageType> for Language {
tokei::LanguageType::Swift => Language::Swift,
tokei::LanguageType::TypeScript => Language::TypeScript,
tokei::LanguageType::JavaScript => Language::JavaScript,
tokei::LanguageType::Perl => Language::Perl,
tokei::LanguageType::Php => Language::Php,
_ => unimplemented!(),
}
Expand Down Expand Up @@ -592,6 +595,7 @@ fn get_all_language_types() -> Vec<tokei::LanguageType> {
tokei::LanguageType::Swift,
tokei::LanguageType::TypeScript,
tokei::LanguageType::JavaScript,
tokei::LanguageType::Perl,
tokei::LanguageType::Php,
]
}
Expand Down Expand Up @@ -621,6 +625,7 @@ impl Info {
Language::Swift => include_str!("../resources/swift.ascii"),
Language::TypeScript => include_str!("../resources/typescript.ascii"),
Language::JavaScript => include_str!("../resources/javascript.ascii"),
Language::Perl => include_str!("../resources/perl.ascii"),
Language::Php => include_str!("../resources/php.ascii"),
// _ => include_str!("../resources/unknown.ascii"),
}
Expand Down Expand Up @@ -650,6 +655,7 @@ impl Info {
Language::Swift => vec![Color::BrightRed],
Language::TypeScript => vec![Color::Cyan],
Language::JavaScript => vec![Color::BrightYellow],
Language::Perl => vec![Color::BrightBlue],
Language::Php => vec![Color::BrightWhite],
}
}
Expand Down

0 comments on commit 1dd1169

Please sign in to comment.