mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-12-08 20:38:47 +00:00
Heuristics on and a bad commit for C++
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
module Linguist
|
module Linguist
|
||||||
# A collection of simple heuristics that can be used to better analyze languages.
|
# A collection of simple heuristics that can be used to better analyze languages.
|
||||||
class Heuristics
|
class Heuristics
|
||||||
ACTIVE = false
|
ACTIVE = true
|
||||||
|
|
||||||
# Public: Given an array of String language names,
|
# Public: Given an array of String language names,
|
||||||
# apply heuristics against the given data and return an array
|
# apply heuristics against the given data and return an array
|
||||||
@@ -42,7 +42,7 @@ module Linguist
|
|||||||
# Returns an array of Languages or []
|
# Returns an array of Languages or []
|
||||||
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?("i")
|
||||||
matches << Language["C++"] if data.include?("#include <cstdint>")
|
matches << Language["C++"] if data.include?("#include <cstdint>")
|
||||||
matches
|
matches
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -282,20 +282,7 @@ C++:
|
|||||||
aliases:
|
aliases:
|
||||||
- cpp
|
- cpp
|
||||||
extensions:
|
extensions:
|
||||||
- .cpp
|
- .a
|
||||||
- .C
|
|
||||||
- .c++
|
|
||||||
- .cc
|
|
||||||
- .cxx
|
|
||||||
- .H
|
|
||||||
- .h++
|
|
||||||
- .hh
|
|
||||||
- .hpp
|
|
||||||
- .hxx
|
|
||||||
- .inl
|
|
||||||
- .tcc
|
|
||||||
- .tpp
|
|
||||||
- .ipp
|
|
||||||
|
|
||||||
C-ObjDump:
|
C-ObjDump:
|
||||||
type: data
|
type: data
|
||||||
|
|||||||
Reference in New Issue
Block a user