Only exact matches

This commit is contained in:
Arfon Smith
2014-10-23 13:59:36 +01:00
parent cf9998f3e4
commit 32de8a4d19
2 changed files with 6 additions and 6 deletions

View File

@@ -38,7 +38,7 @@ module Linguist
# Returns an array of Languages or []
def self.disambiguate_c(data, languages)
matches = []
if (/@(interface|class|protocol|property|end|synchronised|selector|implementation)/.match(data))
if (/@\b(interface|class|protocol|property|end|synchronised|selector|implementation)\b/.match(data))
matches << Language["Objective-C"]
end
if (/^\s*#\s*include <(cstdint|string|vector|map|list|array|bitset|queue|stack|forward_list|unordered_map|unordered_set|(i|o|io)stream)>/.match(data) or