Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Christoph Lipka
2016-02-27 06:24:30 +01:00
74 changed files with 3401 additions and 58 deletions

View File

@@ -72,7 +72,9 @@ module Linguist
vcr_cassette? ||
generated_module? ||
generated_unity3d_meta? ||
generated_racc?
generated_racc? ||
generated_jflex? ||
generated_grammarkit?
end
# Internal: Is the blob an Xcode file?
@@ -373,5 +375,32 @@ module Linguist
return false unless lines.count > 2
return lines[2].start_with?("# This file is automatically generated by Racc")
end
# Internal: Is this a JFlex-generated file?
#
# A JFlex-generated file contains:
# /* The following code was generated by JFlex x.y.z on d/at/e ti:me */
# on the first line.
#
# Return true or false
def generated_jflex?
return false unless extname == '.java'
return false unless lines.count > 1
return lines[0].start_with?("/* The following code was generated by JFlex ")
end
# Internal: Is this a GrammarKit-generated file?
#
# A GrammarKit-generated file typically contain:
# // This is a generated file. Not intended for manual editing.
# on the first line. This is not always the case, as it's possible to
# customize the class header.
#
# Return true or false
def generated_grammarkit?
return false unless extname == '.java'
return false unless lines.count > 1
return lines[0].start_with?("// This is a generated file. Not intended for manual editing.")
end
end
end

View File

@@ -293,6 +293,14 @@ module Linguist
end
end
disambiguate ".pod" do |data|
if /^=\w+$/.match(data)
Language["Pod"]
else
Language["Perl"]
end
end
disambiguate ".pro" do |data|
if /^[^#]+:-/.match(data)
Language["Prolog"]

View File

@@ -183,6 +183,7 @@ AppleScript:
interpreters:
- osascript
ace_mode: applescript
color: "#101F1F"
Arc:
type: programming
@@ -290,6 +291,7 @@ Batchfile:
- .cmd
tm_scope: source.dosbatch
ace_mode: batchfile
color: "#C1F12E"
Befunge:
type: programming
@@ -304,6 +306,7 @@ Bison:
extensions:
- .bison
ace_mode: text
color: "#6A463F"
BitBake:
type: programming
@@ -638,7 +641,7 @@ Common Lisp:
Component Pascal:
type: programming
color: "#b0ce4e"
color: "#B0CE4E"
extensions:
- .cp
- .cps
@@ -701,6 +704,7 @@ Cucumber:
aliases:
- gherkin
ace_mode: text
color: "#5B2063"
Cuda:
type: programming
@@ -709,6 +713,7 @@ Cuda:
- .cuh
tm_scope: source.cuda-c++
ace_mode: c_cpp
color: "#3A4E3A"
Cycript:
type: programming
@@ -801,7 +806,6 @@ Dart:
Diff:
type: data
color: "#88dddd"
extensions:
- .diff
- .patch
@@ -939,6 +943,8 @@ Erlang:
- .es
- .escript
- .hrl
- .xrl
- .yrl
filenames:
- rebar.config
- rebar.config.lock
@@ -1390,6 +1396,7 @@ Hack:
- .hh
- .php
tm_scope: text.html.php
color: "#878787"
Haml:
group: HTML
@@ -1398,6 +1405,7 @@ Haml:
- .haml
- .haml.deface
ace_mode: haml
color: "#ECE2A9"
Handlebars:
type: markup
@@ -1764,6 +1772,7 @@ LLVM:
extensions:
- .ll
ace_mode: text
color: "#185619"
LOLCODE:
type: programming
@@ -1827,6 +1836,7 @@ Less:
- .less
tm_scope: source.css.less
ace_mode: less
color: "#A1D9A1"
Lex:
type: programming
@@ -2019,6 +2029,8 @@ Makefile:
- GNUmakefile
- Kbuild
- Makefile
- Makefile.am
- Makefile.in
- Makefile.inc
- makefile
interpreters:
@@ -2045,6 +2057,7 @@ Markdown:
- .mkdown
- .ron
tm_scope: source.gfm
color: "#083FA1"
Mask:
type: markup
@@ -2284,6 +2297,7 @@ Nginx:
aliases:
- nginx configuration file
ace_mode: text
color: "#9469E9"
Nimrod:
type: programming
@@ -2342,6 +2356,7 @@ NumPy:
- .numsc
tm_scope: none
ace_mode: text
color: "#9C8AF9"
OCaml:
type: programming
@@ -2602,7 +2617,7 @@ Parrot Internal Representation:
Pascal:
type: programming
color: "#b0ce4e"
color: "#E3F171"
extensions:
- .pas
- .dfm
@@ -2651,7 +2666,7 @@ Perl6:
- Rexfile
interpreters:
- perl6
tm_scope: source.perl.6
tm_scope: source.perl6fe
ace_mode: perl
Pickle:
@@ -2746,8 +2761,10 @@ Prolog:
- .pl
- .pro
- .prolog
- .yap
interpreters:
- swipl
- yap
tm_scope: source.prolog
ace_mode: prolog
@@ -2817,6 +2834,7 @@ Python:
color: "#3572A5"
extensions:
- .py
- .bzl
- .cgi
- .fcgi
- .gyp
@@ -2870,7 +2888,7 @@ QMake:
R:
type: programming
color: "#198ce7"
color: "#198CE7"
aliases:
- R
- Rscript
@@ -2900,6 +2918,7 @@ RDoc:
extensions:
- .rdoc
tm_scope: text.rdoc
color: "#8E84BF"
REALbasic:
type: programming
@@ -3091,6 +3110,7 @@ Rust:
color: "#dea584"
extensions:
- .rs
- .rs.in
ace_mode: rust
SAS:
@@ -3108,6 +3128,7 @@ SCSS:
ace_mode: scss
extensions:
- .scss
color: "#CF649A"
SMT:
type: programming
@@ -3210,6 +3231,7 @@ Sass:
extensions:
- .sass
ace_mode: sass
color: "#CF649A"
Scala:
type: programming
@@ -3267,6 +3289,7 @@ Shell:
color: "#89e051"
aliases:
- sh
- shell-script
- bash
- zsh
extensions:
@@ -3277,6 +3300,7 @@ Shell:
- .command
- .fcgi
- .ksh
- .sh.in
- .tmux
- .tool
- .zsh
@@ -3575,7 +3599,6 @@ Unified Parallel C:
Unity3D Asset:
type: data
ace_mode: yaml
color: "#ab69a1"
extensions:
- .anim
- .asset
@@ -3585,6 +3608,13 @@ Unity3D Asset:
- .unity
tm_scope: source.yaml
Uno:
type: programming
extensions:
- .uno
ace_mode: csharp
tm_scope: source.cs
UnrealScript:
type: programming
color: "#a54c4d"
@@ -3791,6 +3821,7 @@ XML:
- .tsx
- .ui
- .urdf
- .ux
- .vbproj
- .vcxproj
- .vxml
@@ -3807,6 +3838,7 @@ XML:
- .xliff
- .xmi
- .xml.dist
- .xproj
- .xsd
- .xul
- .zcml
@@ -3863,6 +3895,7 @@ XSLT:
- .xsl
tm_scope: text.xml.xsl
ace_mode: xml
color: "#EB8CEB"
Xojo:
type: programming
@@ -3896,6 +3929,13 @@ YAML:
- .yaml-tmlanguage
ace_mode: yaml
YANG:
type: data
extensions:
- .yang
tm_scope: source.yang
ace_mode: text
Yacc:
type: programming
extensions:
@@ -3904,6 +3944,7 @@ Yacc:
- .yy
tm_scope: source.bison
ace_mode: text
color: "#4B6C4B"
Zephir:
type: programming
@@ -3943,7 +3984,6 @@ eC:
edn:
type: data
ace_mode: clojure
color: "#db5855"
extensions:
- .edn
tm_scope: source.clojure
@@ -3988,6 +4028,7 @@ reStructuredText:
- .rest.txt
- .rst.txt
ace_mode: text
color: "#B3BCBC"
wisp:
type: programming

View File

@@ -1,8 +1,19 @@
module Linguist
module Strategy
class Modeline
EmacsModeline = /-\*-\s*(?:(?!mode)[\w-]+\s*:\s*(?:[\w+-]+)\s*;?\s*)*(?:mode\s*:)?\s*([\w+-]+)\s*(?:;\s*(?!mode)[\w-]+\s*:\s*[\w+-]+\s*)*;?\s*-\*-/i
VimModeline = /vim:\s*set.*\s(?:ft|filetype)=(\w+)\s?.*:/i
EMACS_MODELINE = /-\*-\s*(?:(?!mode)[\w-]+\s*:\s*(?:[\w+-]+)\s*;?\s*)*(?:mode\s*:)?\s*([\w+-]+)\s*(?:;\s*(?!mode)[\w-]+\s*:\s*[\w+-]+\s*)*;?\s*-\*-/i
# First form vim modeline
# [text]{white}{vi:|vim:|ex:}[white]{options}
# ex: 'vim: syntax=ruby'
VIM_MODELINE_1 = /(?:vim|vi|ex):\s*(?:ft|filetype|syntax)=(\w+)\s?/i
# Second form vim modeline (compatible with some versions of Vi)
# [text]{white}{vi:|vim:|Vim:|ex:}[white]se[t] {options}:[text]
# ex: 'vim set syntax=ruby:'
VIM_MODELINE_2 = /(?:vim|vi|Vim|ex):\s*se(?:t)?.*\s(?:ft|filetype|syntax)=(\w+)\s?.*:/i
MODELINES = [EMACS_MODELINE, VIM_MODELINE_1, VIM_MODELINE_2]
# Public: Detects language based on Vim and Emacs modelines
#
@@ -22,7 +33,7 @@ module Linguist
#
# Returns a String or nil
def self.modeline(data)
match = data.match(EmacsModeline) || data.match(VimModeline)
match = MODELINES.map { |regex| data.match(regex) }.reject(&:nil?).first
match[1] if match
end
end

View File

@@ -1,3 +1,3 @@
module Linguist
VERSION = "4.7.3"
VERSION = "4.7.5"
end