mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-12-08 04:18:48 +00:00
Merging github/master 0872058
This commit is contained in:
@@ -417,6 +417,17 @@ module Linguist
|
||||
end
|
||||
end
|
||||
|
||||
# Internal: Guess language of .cls files
|
||||
#
|
||||
# Returns a Language.
|
||||
def guess_cls_language
|
||||
if lines.grep(/^(%|\\)/).any?
|
||||
Language['TeX']
|
||||
else
|
||||
Language['OpenEdge ABL']
|
||||
end
|
||||
end
|
||||
|
||||
# Internal: Guess language of header files (.h).
|
||||
#
|
||||
# Returns a Language.
|
||||
@@ -511,6 +522,17 @@ module Linguist
|
||||
end
|
||||
end
|
||||
|
||||
# Internal: Guess language of .v files.
|
||||
#
|
||||
# Returns a Language
|
||||
def guess_v_language
|
||||
if lines.grep(/^(\/\*|\/\/|module|parameter|input|output|wire|reg|always|initial|begin|\`)/).any?
|
||||
Language['Verilog']
|
||||
else
|
||||
Language['Coq']
|
||||
end
|
||||
end
|
||||
|
||||
# Internal: Guess language of .gsp files.
|
||||
#
|
||||
# Returns a Language.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
require 'yaml'
|
||||
require 'escape_utils'
|
||||
require 'pygments'
|
||||
require 'yaml'
|
||||
|
||||
module Linguist
|
||||
# Language names that are recognizable by GitHub. Defined languages
|
||||
@@ -322,6 +323,19 @@ module Linguist
|
||||
# Returns the extensions Array
|
||||
attr_reader :filenames
|
||||
|
||||
# Public: Get URL escaped name.
|
||||
#
|
||||
# Examples
|
||||
#
|
||||
# "C%23"
|
||||
# "C%2B%2B"
|
||||
# "Common%20Lisp"
|
||||
#
|
||||
# Returns the escaped String.
|
||||
def escaped_name
|
||||
EscapeUtils.escape_url(name).gsub('+', '%20')
|
||||
end
|
||||
|
||||
# Internal: Get default alias name
|
||||
#
|
||||
# Returns the alias name String
|
||||
|
||||
@@ -120,6 +120,11 @@ Brainfuck:
|
||||
- .b
|
||||
- .bf
|
||||
|
||||
Bro:
|
||||
type: programming
|
||||
extensions:
|
||||
- .bro
|
||||
|
||||
C:
|
||||
type: programming
|
||||
overrides:
|
||||
@@ -128,6 +133,7 @@ C:
|
||||
extensions:
|
||||
- .c
|
||||
- .h
|
||||
- .w
|
||||
|
||||
C#:
|
||||
type: programming
|
||||
@@ -162,6 +168,15 @@ C-ObjDump:
|
||||
extensions:
|
||||
- .c-objdump
|
||||
|
||||
C2hs Haskell:
|
||||
type: programming
|
||||
lexer: Haskell
|
||||
group: Haskell
|
||||
aliases:
|
||||
- c2hs
|
||||
extensions:
|
||||
- .chs
|
||||
|
||||
CMake:
|
||||
extensions:
|
||||
- .cmake
|
||||
@@ -214,6 +229,12 @@ Common Lisp:
|
||||
- .lisp
|
||||
- .ny
|
||||
|
||||
Coq:
|
||||
type: programming
|
||||
lexer: Coq
|
||||
extensions:
|
||||
- .v
|
||||
|
||||
Cpp-ObjDump:
|
||||
type: data
|
||||
lexer: cpp-objdump
|
||||
@@ -280,6 +301,13 @@ Eiffel:
|
||||
extensions:
|
||||
- .e
|
||||
|
||||
Elixir:
|
||||
type: programming
|
||||
primary_extension: .ex
|
||||
extensions:
|
||||
- .ex
|
||||
- .exs
|
||||
|
||||
Emacs Lisp:
|
||||
type: programming
|
||||
lexer: Scheme
|
||||
@@ -566,6 +594,12 @@ Literate Haskell:
|
||||
extensions:
|
||||
- .lhs
|
||||
|
||||
Logtalk:
|
||||
type: programming
|
||||
primary_extension: .lgt
|
||||
extensions:
|
||||
- .lgt
|
||||
|
||||
Lua:
|
||||
type: programming
|
||||
primary_extension: .lua
|
||||
@@ -706,6 +740,19 @@ OpenCL:
|
||||
extensions:
|
||||
- .cl
|
||||
|
||||
OpenEdge ABL:
|
||||
type: programming
|
||||
aliases:
|
||||
- progress
|
||||
- openedge
|
||||
- abl
|
||||
primary_extension: .p
|
||||
overrides:
|
||||
- .cls
|
||||
extensions:
|
||||
- .cls
|
||||
- .p
|
||||
|
||||
PHP:
|
||||
type: programming
|
||||
extensions:
|
||||
@@ -757,6 +804,15 @@ Perl:
|
||||
- .psgi
|
||||
- .t
|
||||
|
||||
Powershell:
|
||||
type: programming
|
||||
lexer: Text only
|
||||
aliases:
|
||||
- posh
|
||||
extensions:
|
||||
- .ps1
|
||||
- .psm1
|
||||
|
||||
Prolog:
|
||||
type: programming
|
||||
extensions:
|
||||
@@ -920,6 +976,13 @@ Scheme:
|
||||
- .sps
|
||||
- .ss
|
||||
|
||||
Scilab:
|
||||
type: programming
|
||||
primary_extension: .sci
|
||||
extensions:
|
||||
- .sce
|
||||
- .tst
|
||||
|
||||
Self:
|
||||
type: programming
|
||||
lexer: Text only
|
||||
@@ -1050,6 +1113,8 @@ Vala:
|
||||
Verilog:
|
||||
type: programming
|
||||
lexer: verilog
|
||||
overrides:
|
||||
- .v
|
||||
extensions:
|
||||
- .v
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@ application/xaml+xml @xaml :8bit
|
||||
image/x-icns @icns
|
||||
text/cache-manifest @manifest
|
||||
text/plain @cu,cxx
|
||||
text/x-logtalk @lgt
|
||||
text/x-nemerle @n
|
||||
text/x-nimrod @nim
|
||||
text/x-ocaml @ml,mli,mll,mly,sig,sml
|
||||
|
||||
Reference in New Issue
Block a user