mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Merge branch 'master' of git://github.com/github/linguist
This commit is contained in:
@@ -158,6 +158,13 @@ module Linguist
|
||||
extname.downcase == '.stl'
|
||||
end
|
||||
|
||||
# Public: Is this blob a CSV file?
|
||||
#
|
||||
# Return true or false
|
||||
def csv?
|
||||
text? && extname.downcase == '.csv'
|
||||
end
|
||||
|
||||
# Public: Is the blob a PDF?
|
||||
#
|
||||
# Return true or false
|
||||
|
||||
@@ -56,7 +56,8 @@ module Linguist
|
||||
compiled_coffeescript? ||
|
||||
xcode_project_file? ||
|
||||
generated_net_docfile? ||
|
||||
generated_parser?
|
||||
generated_parser? ||
|
||||
generated_protocol_buffer?
|
||||
end
|
||||
|
||||
# Internal: Is the blob an XCode project file?
|
||||
@@ -158,5 +159,16 @@ module Linguist
|
||||
|
||||
false
|
||||
end
|
||||
|
||||
# Internal: Is the blob a C++, Java or Python source file generated by the
|
||||
# Protocol Buffer compiler?
|
||||
#
|
||||
# Returns true of false.
|
||||
def generated_protocol_buffer?
|
||||
return false unless ['.py', '.java', '.h', '.cc', '.cpp'].include?(extname)
|
||||
return false unless lines.count > 1
|
||||
|
||||
return lines[0].include?("Generated by the protocol buffer compiler. DO NOT EDIT!")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1291,6 +1291,14 @@ TypeScript:
|
||||
- ts
|
||||
primary_extension: .ts
|
||||
|
||||
Unified Parallel C:
|
||||
type: programming
|
||||
group: C
|
||||
lexer: C
|
||||
ace_mode: c_cpp
|
||||
color: "#755223"
|
||||
primary_extension: .upc
|
||||
|
||||
VHDL:
|
||||
type: programming
|
||||
lexer: vhdl
|
||||
|
||||
@@ -32,7 +32,8 @@ module Linguist
|
||||
['/*', '*/'], # C
|
||||
['<!--', '-->'], # XML
|
||||
['{-', '-}'], # Haskell
|
||||
['(*', '*)'] # Coq
|
||||
['(*', '*)'], # Coq
|
||||
['"""', '"""'] # Python
|
||||
]
|
||||
|
||||
START_SINGLE_LINE_COMMENT = Regexp.compile(SINGLE_LINE_COMMENTS.map { |c|
|
||||
|
||||
Reference in New Issue
Block a user