mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Added Turing language detection
This commit is contained in:
@@ -467,6 +467,20 @@ module Linguist
|
|||||||
Language['R']
|
Language['R']
|
||||||
end
|
end
|
||||||
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.
|
# Internal: Guess language of .gsp files.
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -717,6 +717,7 @@ Perl:
|
|||||||
type: programming
|
type: programming
|
||||||
overrides:
|
overrides:
|
||||||
- .pl
|
- .pl
|
||||||
|
- .t
|
||||||
primary_extension: .pl
|
primary_extension: .pl
|
||||||
extensions:
|
extensions:
|
||||||
- .PL
|
- .PL
|
||||||
@@ -965,6 +966,14 @@ Textile:
|
|||||||
lexer: Text only
|
lexer: Text only
|
||||||
extensions:
|
extensions:
|
||||||
- .textile
|
- .textile
|
||||||
|
|
||||||
|
Turing:
|
||||||
|
type: programming
|
||||||
|
lexer: Text only
|
||||||
|
primary_extension: .t
|
||||||
|
extensions:
|
||||||
|
- .t
|
||||||
|
- .tu
|
||||||
|
|
||||||
Twig:
|
Twig:
|
||||||
type: markup
|
type: markup
|
||||||
|
|||||||
Reference in New Issue
Block a user