mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Add .mm as an XML extension with heuristic rule
This commit is contained in:
@@ -34,6 +34,9 @@ module Linguist
|
||||
if languages.all? { |l| ["AsciiDoc", "AGS Script"].include?(l) }
|
||||
result = disambiguate_asc(data, languages)
|
||||
end
|
||||
if languages.all? { |l| ["XML", "Objective-C++"].include?(l) }
|
||||
result = disambiguate_mm(data, languages)
|
||||
end
|
||||
return result
|
||||
end
|
||||
end
|
||||
@@ -124,6 +127,16 @@ module Linguist
|
||||
matches
|
||||
end
|
||||
|
||||
def self.disambiguate_mm(data, languages)
|
||||
matches = []
|
||||
if /<map version="[^"]+">/.match(data)
|
||||
matches << Language["XML"]
|
||||
else
|
||||
matches << Language["Objective-C++"]
|
||||
end
|
||||
matches
|
||||
end
|
||||
|
||||
def self.active?
|
||||
!!ACTIVE
|
||||
end
|
||||
|
||||
@@ -2771,6 +2771,7 @@ XML:
|
||||
- .jelly
|
||||
- .kml
|
||||
- .launch
|
||||
- .mm
|
||||
- .mxml
|
||||
- .nproj
|
||||
- .nuspec
|
||||
|
||||
Reference in New Issue
Block a user