Support of the .ecl file extension for Prolog.

This commit is contained in:
Paul Chaignon
2014-02-01 15:47:51 +01:00
parent dd32b8f441
commit f78ce5389e
4 changed files with 113 additions and 0 deletions

View File

@@ -19,6 +19,9 @@ module Linguist
if languages.all? { |l| ["Perl", "Prolog"].include?(l) }
disambiguate_pl(data, languages)
end
if languages.all? { |l| ["ECL", "Prolog"].include?(l) }
disambiguate_ecl(data, languages)
end
if languages.all? { |l| ["TypeScript", "XML"].include?(l) }
disambiguate_ts(data, languages)
end
@@ -46,6 +49,13 @@ module Linguist
matches
end
def self.disambiguate_ecl(data, languages)
matches = []
matches << Language["Prolog"] if data.include?(":-")
matches << Language["ECL"] if data.include?(":=")
matches
end
def self.disambiguate_ts(data, languages)
matches = []
if (data.include?("</translation>"))