lib/linguist/heuristics.rb in github-linguist-4.2.5 vs lib/linguist/heuristics.rb in github-linguist-4.2.6

- old
+ new

@@ -68,13 +68,13 @@ Language["BitBake"] end end disambiguate "Objective-C", "C++", "C" do |data| - if (/@(interface|class|protocol|property|end|synchronised|selector|implementation)\b/.match(data)) + if (/^[ \t]*@(interface|class|protocol|property|end|synchronised|selector|implementation)\b/.match(data)) Language["Objective-C"] elsif (/^\s*#\s*include <(cstdint|string|vector|map|list|array|bitset|queue|stack|forward_list|unordered_map|unordered_set|(i|o|io)stream)>/.match(data) || - /^\s*template\s*</.match(data) || /^[^@]class\s+\w+/.match(data) || /^[^@](private|public|protected):$/.match(data) || /std::.+$/.match(data)) + /^\s*template\s*</.match(data) || /^[ \t]*try/.match(data) || /^[ \t]*catch\s*\(/.match(data) || /^[ \t]*(class|(using[ \t]+)?namespace)\s+\w+/.match(data) || /^[ \t]*(private|public|protected):$/.match(data) || /std::\w+/.match(data)) Language["C++"] end end disambiguate "Perl", "Perl6", "Prolog" do |data|