mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Add heuristic distinguishing GAP and Scilab .tst files
This commit is contained in:
@@ -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 ")
|
||||
|
||||
Reference in New Issue
Block a user