mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
A C++ shibboleth?
This commit is contained in:
@@ -16,12 +16,14 @@ module Linguist
|
||||
end
|
||||
|
||||
# .h extensions are ambigious between C, C++, and Objective-C.
|
||||
# We want to shortcut look for Objective-C.
|
||||
# We want to shortcut look for Objective-C _and_ now C++ too!
|
||||
#
|
||||
# Returns an array of Languages or []
|
||||
# TODO rename this method as we're not strictly disambiguating between .h files here.
|
||||
def self.disambiguate_h(data, languages)
|
||||
matches = []
|
||||
matches << Language["Objective-C"] if data.include?("@interface")
|
||||
matches << Language["C++"] if data.include?("#include <cstdint>")
|
||||
matches
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user