Merge branch 'detect-turing-language' of https://github.com/Open-Turing-Project/linguist into Open-Turing-Project-detect-turing-language

This commit is contained in:
Joshua Peek
2011-11-21 10:17:39 -06:00
2 changed files with 23 additions and 0 deletions

View File

@@ -468,6 +468,20 @@ module Linguist
end
end
# Internal: Guess language of .t files.
#
# Makes fairly sure that it is Turing.
# Turing is not very popular so it would not be good to have perl users' files being confused.
#
# Returns a Language.
def guess_t_language
if lines.grep(/:=/).any? && lines.grep(/proc |procedure |fcn |function /).any? && lines.grep(/var/).any?
Language['Turing']
else
Language['Perl']
end
end
# Internal: Guess language of .gsp files.
#
# Returns a Language.

View File

@@ -723,6 +723,7 @@ Perl:
type: programming
overrides:
- .pl
- .t
primary_extension: .pl
extensions:
- .PL
@@ -972,6 +973,14 @@ Textile:
extensions:
- .textile
Turing:
type: programming
lexer: Text only
primary_extension: .t
extensions:
- .t
- .tu
Twig:
type: markup
group: PHP