Add heuristic distinguishing GAP and Scilab .tst files

This commit is contained in:
Max Horn
2014-11-10 11:43:30 +01:00
parent ff6a10698e
commit f9ad5dda56

View File

@@ -40,6 +40,9 @@ module Linguist
if languages.all? { |l| ["FORTRAN", "Forth"].include?(l) }
result = disambiguate_f(data)
end
if name.end_with? ".tst" and languages.all? { |l| ["GAP", "Scilab"].include?(l) }
result = disambiguate_tst(data)
end
return result
end
end
@@ -98,6 +101,16 @@ module Linguist
matches
end
def self.disambiguate_tst(data)
matches = []
if (data.include?("gap> "))
matches << Language["GAP"]
else
matches << Language["Scilab"]
end
matches
end
def self.disambiguate_cl(data)
matches = []
if data.include?("(defun ")