Starting work on Disambiguate Matlab, Objective-C, Mathematica, M, and Mercury method

This commit is contained in:
Arfon Smith
2014-10-31 17:22:32 -05:00
parent 21f56744d4
commit 5ffc4c0158

View File

@@ -25,6 +25,9 @@ module Linguist
if languages.all? { |l| ["Common Lisp", "OpenCL"].include?(l) }
result = disambiguate_cl(data, languages)
end
if languages.all? { |l| ["M", "Matlab", "Mathematica", "Mercury", "Objective-C"].include?(l) }
result = disambiguate_m(data, languages)
end
return result
end
end
@@ -88,6 +91,15 @@ module Linguist
matches
end
def self.disambiguate_m(data, languages)
matches = []
if (/@(interface|class|protocol|property|end|synchronised|selector|implementation)\b/.match(data))
matches << Language["Objective-C"]
end
# TODO add matchers for "M", "Matlab", "Mathematica", "Mercury"
matches
end
def self.active?
!!ACTIVE
end