mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Improved the C++ heuristic for detecting based on included headers
This commit is contained in:
@@ -38,7 +38,8 @@ module Linguist
|
|||||||
def self.disambiguate_c(data, languages)
|
def self.disambiguate_c(data, languages)
|
||||||
matches = []
|
matches = []
|
||||||
matches << Language["Objective-C"] if data.include?("@interface")
|
matches << Language["Objective-C"] if data.include?("@interface")
|
||||||
matches << Language["C++"] if data.include?("#include <cstdint>")
|
if (/^\s*#\s*include <(cstdint|string|vector|map|list|array|bitset|queue|stack|forward_list|unordered_map|unordered_set)>$/.match(data))
|
||||||
|
matches << Language["C++"]
|
||||||
matches
|
matches
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user