mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Starting work on Disambiguate Matlab, Objective-C, Mathematica, M, and Mercury method
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user