Merge branch 'master' into 1623-local

Conflicts:
	lib/linguist/heuristics.rb
This commit is contained in:
Arfon Smith
2014-11-02 19:58:50 -06:00
parent 49c2793bf5
commit 9d8ab16a38
20 changed files with 1552 additions and 24 deletions

View File

@@ -28,6 +28,9 @@ module Linguist
if languages.all? { |l| ["Scala", "SuperCollider"].include?(l) }
result = disambiguate_sc(data, languages)
end
if languages.all? { |l| ["AsciiDoc", "AGS Script"].include?(l) }
result = disambiguate_asc(data, languages)
end
return result
end
end
@@ -102,6 +105,12 @@ module Linguist
matches
end
def self.disambiguate_asc(data, languages)
matches = []
matches << Language["AsciiDoc"] if /^=+(\s|\n)/.match(data)
matches
end
def self.active?
!!ACTIVE
end

View File

@@ -2,7 +2,7 @@ require 'escape_utils'
require 'pygments'
require 'yaml'
begin
require 'json'
require 'yajl'
rescue LoadError
end
@@ -533,8 +533,8 @@ module Linguist
languages_yml = File.expand_path("../languages.yml", __FILE__)
languages_json = File.expand_path("../languages.json", __FILE__)
if File.exist?(languages_json) && defined?(JSON)
languages = JSON.load(File.read(languages_json))
if File.exist?(languages_json) && defined?(Yajl)
languages = Yajl.load(File.read(languages_json))
else
languages = YAML.load_file(languages_yml)
end

View File

@@ -37,6 +37,7 @@ AGS Script:
extensions:
- .asc
- .ash
tm_scope: source.c++
ANTLR:
type: programming
@@ -50,6 +51,7 @@ APL:
color: "#8a0707"
extensions:
- .apl
- .dyalog
ASP:
type: programming
@@ -79,6 +81,7 @@ ATS:
- .atxt
- .hats
- .sats
tm_scope: source.ocaml
ActionScript:
type: programming
@@ -117,12 +120,14 @@ ApacheConf:
- apache
extensions:
- .apacheconf
tm_scope: source.apache-config
Apex:
type: programming
lexer: Java
extensions:
- .cls
tm_scope: source.java
AppleScript:
type: programming
@@ -147,6 +152,7 @@ Arduino:
lexer: C++
extensions:
- .ino
tm_scope: source.c++
AsciiDoc:
type: prose
@@ -175,6 +181,7 @@ Assembly:
extensions:
- .asm
- .a51
tm_scope: source.asm.x86
Augeas:
type: programming
@@ -199,6 +206,7 @@ AutoIt:
- AutoItScript
extensions:
- .au3
tm_scope: source.autoit.3
Awk:
type: programming
@@ -224,6 +232,7 @@ Batchfile:
extensions:
- .bat
- .cmd
tm_scope: source.dosbatch
Befunge:
extensions:
@@ -237,6 +246,7 @@ BlitzBasic:
extensions:
- .bb
- .decls
tm_scope: source.blitzmax
BlitzMax:
type: programming
@@ -249,6 +259,7 @@ Bluespec:
lexer: verilog
extensions:
- .bsv
tm_scope: source.verilog
Boo:
type: programming
@@ -260,6 +271,7 @@ Brainfuck:
extensions:
- .b
- .bf
tm_scope: source.bf
Brightscript:
type: programming
@@ -323,6 +335,7 @@ C-ObjDump:
lexer: c-objdump
extensions:
- .c-objdump
tm_scope: objdump.x86asm
C2hs Haskell:
type: programming
@@ -332,6 +345,7 @@ C2hs Haskell:
- c2hs
extensions:
- .chs
tm_scope: source.haskell
CLIPS:
type: programming
@@ -379,6 +393,7 @@ ChucK:
lexer: Java
extensions:
- .ck
tm_scope: source.java
Cirru:
type: programming
@@ -442,6 +457,7 @@ ColdFusion:
- cfml
extensions:
- .cfm
tm_scope: text.html.cfm
ColdFusion CFC:
type: programming
@@ -454,6 +470,7 @@ ColdFusion CFC:
- cfc
extensions:
- .cfc
tm_scope: source.cfscript
Common Lisp:
type: programming
@@ -482,6 +499,7 @@ Component Pascal:
extensions:
- .cp
- .cps
tm_scope: source.pascal
Coq:
type: programming
@@ -496,6 +514,7 @@ Cpp-ObjDump:
- .cppobjdump
- .c++objdump
- .cxx-objdump
tm_scope: objdump.x86asm
Creole:
type: prose
@@ -510,11 +529,13 @@ Crystal:
extensions:
- .cr
ace_mode: ruby
tm_scope: source.ruby
Cucumber:
lexer: Gherkin
extensions:
- .feature
tm_scope: text.gherkin.feature
Cuda:
type: programming
@@ -522,12 +543,14 @@ Cuda:
extensions:
- .cu
- .cuh
tm_scope: source.cuda-c++
Cycript:
type: programming
lexer: JavaScript
extensions:
- .cy
tm_scope: source.js
Cython:
type: programming
@@ -549,6 +572,7 @@ D-ObjDump:
lexer: d-objdump
extensions:
- .d-objdump
tm_scope: objdump.x86asm
DM:
type: programming
@@ -558,6 +582,7 @@ DM:
- .dm
aliases:
- byond
tm_scope: source.c++
DOT:
type: data
@@ -613,6 +638,7 @@ Ecere Projects:
lexer: JSON
extensions:
- .epj
tm_scope: source.json
ECL:
type: programming
@@ -629,6 +655,7 @@ Eagle:
extensions:
- .sch
- .brd
tm_scope: text.xml
Eiffel:
type: programming
@@ -649,6 +676,7 @@ Elm:
lexer: Haskell
extensions:
- .elm
tm_scope: source.haskell
Emacs Lisp:
type: programming
@@ -671,6 +699,7 @@ EmberScript:
extensions:
- .em
- .emberscript
tm_scope: source.coffee
Erlang:
type: programming
@@ -691,6 +720,7 @@ F#:
- .fs
- .fsi
- .fsx
tm_scope: source.fsharp
FLUX:
type: programming
@@ -745,6 +775,7 @@ Fantom:
color: "#dbded5"
extensions:
- .fan
tm_scope: source.fan
Forth:
type: programming
@@ -762,6 +793,7 @@ Frege:
lexer: Haskell
extensions:
- .fr
tm_scope: source.haskell
G-code:
type: data
@@ -777,6 +809,7 @@ Game Maker Language:
lexer: JavaScript
extensions:
- .gml
tm_scope: source.js
GAMS:
type: programming
@@ -826,18 +859,21 @@ GLSL:
Genshi:
extensions:
- .kid
tm_scope: text.xml.genshi
Gentoo Ebuild:
group: Shell
lexer: Bash
extensions:
- .ebuild
tm_scope: source.shell
Gentoo Eclass:
group: Shell
lexer: Bash
extensions:
- .eclass
tm_scope: source.shell
Gettext Catalog:
search_term: pot
@@ -847,6 +883,7 @@ Gettext Catalog:
extensions:
- .po
- .pot
tm_scope: source.po
Glyph:
type: programming
@@ -854,6 +891,7 @@ Glyph:
lexer: Tcl
extensions:
- .glf
tm_scope: source.tcl
Gnuplot:
type: programming
@@ -880,6 +918,7 @@ Gosu:
- .gst
- .gsx
- .vark
tm_scope: source.gosu.2
Grace:
type: programming
@@ -897,6 +936,7 @@ Grammatical Framework:
- .gf
searchable: true
color: "#ff0000"
tm_scope: source.haskell
Graph Modeling Language:
type: data
@@ -914,6 +954,7 @@ Groff:
- '.5'
- '.6'
- '.7'
tm_scope: text.groff
Groovy:
type: programming
@@ -921,7 +962,6 @@ Groovy:
color: "#e69f56"
extensions:
- .groovy
- .gradle
- .grt
- .gtpl
- .gvy
@@ -935,6 +975,7 @@ Groovy Server Pages:
- gsp
extensions:
- .gsp
tm_scope: text.html.jsp
HTML:
type: markup
@@ -959,7 +1000,7 @@ HTML+Django:
HTML+ERB:
type: markup
tm_scope: text.html.ruby
tm_scope: text.html.erb
group: HTML
lexer: RHTML
aliases:
@@ -995,6 +1036,7 @@ Handlebars:
extensions:
- .handlebars
- .hbs
tm_scope: text.html.handlebars
Harbour:
type: programming
@@ -1017,6 +1059,7 @@ Haxe:
extensions:
- .hx
- .hxsl
tm_scope: source.haxe.2
Hy:
type: programming
@@ -1046,6 +1089,7 @@ INI:
- .ini
- .prefs
- .properties
tm_scope: source.ini
Inno Setup:
extensions:
@@ -1066,6 +1110,7 @@ Inform 7:
extensions:
- .ni
- .i7x
tm_scope: source.inform
Inno Setup:
extensions:
@@ -1131,6 +1176,7 @@ JSON5:
lexer: JavaScript
extensions:
- .json5
tm_scope: source.js
JSONLD:
type: data
@@ -1139,6 +1185,7 @@ JSONLD:
lexer: JavaScript
extensions:
- .jsonld
tm_scope: source.js
JSONiq:
type: programming
@@ -1146,12 +1193,14 @@ JSONiq:
lexer: XQuery
extensions:
- .jq
tm_scope: source.xquery
Jade:
group: HTML
type: markup
extensions:
- .jade
tm_scope: source.jade
Java:
type: programming
@@ -1168,6 +1217,7 @@ Java Server Pages:
- jsp
extensions:
- .jsp
tm_scope: text.html.jsp
JavaScript:
type: programming
@@ -1219,6 +1269,7 @@ Kit:
ace_mode: html
extensions:
- .kit
tm_scope: text.html.basic
Kotlin:
type: programming
@@ -1226,6 +1277,7 @@ Kotlin:
- .kt
- .ktm
- .kts
tm_scope: source.Kotlin
LFE:
type: programming
@@ -1234,11 +1286,19 @@ LFE:
color: "#004200"
lexer: Common Lisp
group: Erlang
tm_scope: source.lisp
LLVM:
extensions:
- .ll
LOLCODE:
type: programming
lexer: Text only
extensions:
- .lol
color: "#cc9900"
LSL:
type: programming
lexer: LSL
@@ -1264,6 +1324,7 @@ Lasso:
- .las
- .lasso9
- .ldml
tm_scope: file.lasso
Latte:
type: markup
@@ -1272,6 +1333,7 @@ Latte:
lexer: Smarty
extensions:
- .latte
tm_scope: source.smarty
Less:
type: markup
@@ -1279,6 +1341,7 @@ Less:
lexer: CSS
extensions:
- .less
tm_scope: source.css
LilyPond:
lexer: Text only
@@ -1319,6 +1382,7 @@ Literate Haskell:
- lhs
extensions:
- .lhs
tm_scope: text.tex.latex.haskell
LiveScript:
type: programming
@@ -1350,6 +1414,7 @@ LookML:
color: "#652B81"
extensions:
- .lookml
tm_scope: source.yaml
Lua:
type: programming
@@ -1372,6 +1437,7 @@ M:
extensions:
- .mumps
- .m
tm_scope: source.lisp
MTML:
type: markup
@@ -1379,6 +1445,7 @@ MTML:
color: "#0095d9"
extensions:
- .mtml
tm_scope: text.html.basic
Makefile:
aliases:
@@ -1397,6 +1464,7 @@ Mako:
extensions:
- .mako
- .mao
tm_scope: text.html.mako
Markdown:
type: prose
@@ -1410,6 +1478,7 @@ Markdown:
- .mkdn
- .mkdown
- .ron
tm_scope: text.html.markdown
Mask:
type: markup
@@ -1418,6 +1487,7 @@ Mask:
ace_mode: scss
extensions:
- .mask
tm_scope: source.scss
Mathematica:
type: programming
@@ -1448,6 +1518,7 @@ Max:
- .maxproj
- .mxt
- .pat
tm_scope: source.json
MediaWiki:
type: prose
@@ -1464,6 +1535,7 @@ Mercury:
extensions:
- .m
- .moo
tm_scope: source.prolog
MiniD: # Legacy
searchable: false
@@ -1480,6 +1552,7 @@ Mirah:
- .duby
- .mir
- .mirah
tm_scope: source.ruby
Monkey:
type: programming
@@ -1497,6 +1570,8 @@ MoonScript:
type: programming
extensions:
- .moon
interpreters:
- moon
Myghty:
extensions:
@@ -1519,12 +1594,14 @@ NetLogo:
color: "#ff2b2b"
extensions:
- .nlogo
tm_scope: source.lisp
Nginx:
type: markup
lexer: Nginx configuration file
extensions:
- .nginxconf
tm_scope: source.nginx
Nimrod:
type: programming
@@ -1556,6 +1633,7 @@ Nu:
- .nu
filenames:
- Nukefile
tm_scope: source.scheme
NumPy:
group: Python
@@ -1582,6 +1660,7 @@ ObjDump:
lexer: objdump
extensions:
- .objdump
tm_scope: objdump.x86asm
Objective-C:
type: programming
@@ -1612,6 +1691,7 @@ Objective-J:
extensions:
- .j
- .sj
tm_scope: source.js.objj
Omgrofl:
type: programming
@@ -1639,6 +1719,7 @@ OpenCL:
extensions:
- .cl
- .opencl
tm_scope: source.c
OpenEdge ABL:
type: programming
@@ -1649,6 +1730,7 @@ OpenEdge ABL:
extensions:
- .p
- .cls
tm_scope: source.abl
OpenSCAD:
type: programming
@@ -1684,6 +1766,7 @@ PAWN:
color: "#dbb284"
extensions:
- .pwn
tm_scope: source.c++
PHP:
type: programming
@@ -1712,6 +1795,13 @@ Pan:
extensions:
- .pan
Papyrus:
type: programming
color: "#6600cc"
lexer: Text only
extensions:
- .psc
Parrot:
type: programming
color: "#f3ca0a"
@@ -1815,6 +1905,7 @@ PostScript:
extensions:
- .ps
- .eps
tm_scope: source.postscript
PowerShell:
type: programming
@@ -1857,6 +1948,7 @@ Protocol Buffer:
- Protocol Buffers
extensions:
- .proto
tm_scope: source.protobuf
Puppet:
type: programming
@@ -1879,6 +1971,7 @@ PureScript:
lexer: Haskell
extensions:
- .purs
tm_scope: source.haskell
Python:
type: programming
@@ -1916,6 +2009,7 @@ QML:
color: "#44a51c"
extensions:
- .qml
tm_scope: source.qml
QMake:
lexer: Text only
@@ -1948,6 +2042,7 @@ RDoc:
wrap: true
extensions:
- .rdoc
tm_scope: text.rdoc
REALbasic:
type: programming
@@ -1959,12 +2054,14 @@ REALbasic:
- .rbres
- .rbtbar
- .rbuistate
tm_scope: source.vbnet
RHTML:
type: markup
group: HTML
extensions:
- .rhtml
tm_scope: text.html.ruby
RMarkdown:
type: prose
@@ -1984,6 +2081,7 @@ Racket:
- .rktd
- .rktl
- .scrbl
tm_scope: source.scheme
Ragel in Ruby Host:
type: programming
@@ -2027,6 +2125,7 @@ RobotFramework:
extensions:
- .robot
# - .txt
tm_scope: text.robot
Rouge:
type: programming
@@ -2035,6 +2134,7 @@ Rouge:
color: "#cc0088"
extensions:
- .rg
tm_scope: source.clojure
Ruby:
type: programming
@@ -2110,6 +2210,7 @@ SQF:
extensions:
- .sqf
- .hqf
tm_scope: source.c++
SQL:
type: data
@@ -2128,6 +2229,7 @@ STON:
lexer: JSON
extensions:
- .ston
tm_scope: source.json
Sage:
type: programming
@@ -2135,6 +2237,7 @@ Sage:
group: Python
extensions:
- .sage
tm_scope: source.python
Sass:
type: markup
@@ -2158,6 +2261,7 @@ Scaml:
type: markup
extensions:
- .scaml
tm_scope: source.scaml
Scheme:
type: programming
@@ -2192,7 +2296,7 @@ Shell:
type: programming
lexer: Bash
search_term: bash
color: "#5861ce"
color: "#89e051"
aliases:
- sh
- bash
@@ -2202,6 +2306,7 @@ Shell:
- .bash
- .bats
- .cgi
- .command
- .fcgi
- .tmux
- .zsh
@@ -2230,6 +2335,7 @@ Slash:
color: "#007eff"
extensions:
- .sl
tm_scope: text.html.slash
Slim:
group: HTML
@@ -2256,12 +2362,14 @@ SourcePawn:
- sourcemod
extensions:
- .sp
tm_scope: source.sp
Squirrel:
type: programming
lexer: C++
extensions:
- .nut
tm_scope: source.c++
Standard ML:
type: programming
@@ -2273,6 +2381,7 @@ Standard ML:
- .fun
- .sig
- .sml
tm_scope: source.ml
Stata:
type: programming
@@ -2321,6 +2430,7 @@ TOML:
type: data
extensions:
- .toml
tm_scope: source.toml
TXL:
type: programming
@@ -2345,6 +2455,7 @@ Tcsh:
extensions:
- .tcsh
- .csh
tm_scope: source.shell
TeX:
type: markup
@@ -2374,6 +2485,7 @@ Tea:
type: markup
extensions:
- .tea
tm_scope: source.tea
Textile:
type: prose
@@ -2397,6 +2509,7 @@ Twig:
lexer: HTML+Django/Jinja
extensions:
- .twig
tm_scope: text.html.twig
TypeScript:
type: programming
@@ -2405,6 +2518,7 @@ TypeScript:
- ts
extensions:
- .ts
tm_scope: source.ts
Unified Parallel C:
type: programming
@@ -2414,6 +2528,7 @@ Unified Parallel C:
color: "#755223"
extensions:
- .upc
tm_scope: source.c
UnrealScript:
type: programming
@@ -2421,6 +2536,7 @@ UnrealScript:
lexer: Java
extensions:
- .uc
tm_scope: source.java
VCL:
type: programming
@@ -2429,6 +2545,7 @@ VCL:
color: "#0298c3"
extensions:
- .vcl
tm_scope: source.perl
VHDL:
type: programming
@@ -2486,6 +2603,7 @@ Visual Basic:
- .vba
- .vbhtml
- .vbs
tm_scope: source.vbnet
Volt:
type: programming
@@ -2493,12 +2611,14 @@ Volt:
color: "#0098db"
extensions:
- .volt
tm_scope: source.d
XC:
type: programming
lexer: C
extensions:
- .xc
tm_scope: source.c
XML:
type: markup
@@ -2569,6 +2689,7 @@ XML:
filenames:
- .classpath
- .project
- build.xml.dist
- phpunit.xml.dist
XProc:
@@ -2577,6 +2698,7 @@ XProc:
extensions:
- .xpl
- .xproc
tm_scope: text.xml
XQuery:
type: programming
@@ -2592,6 +2714,7 @@ XS:
lexer: C
extensions:
- .xs
tm_scope: source.c
XSLT:
type: programming
@@ -2600,6 +2723,7 @@ XSLT:
extensions:
- .xslt
- .xsl
tm_scope: text.xml.xsl
Xojo:
type: programming
@@ -2611,6 +2735,7 @@ Xojo:
- .xojo_script
- .xojo_toolbar
- .xojo_window
tm_scope: source.vbnet
Xtend:
type: programming
@@ -2634,6 +2759,7 @@ Zephir:
color: "#118f9e"
extensions:
- .zep
tm_scope: text.html.php
Zimpl:
type: programming
@@ -2657,6 +2783,7 @@ edn:
color: "#db5855"
extensions:
- .edn
tm_scope: source.clojure
fish:
type: programming
@@ -2701,6 +2828,7 @@ wisp:
color: "#7582D1"
extensions:
- .wisp
tm_scope: source.clojure
xBase:
type: programming

View File

@@ -1,5 +1,5 @@
begin
require 'json'
require 'yajl'
rescue LoadError
require 'yaml'
end
@@ -19,7 +19,7 @@ module Linguist
# Hash of serialized samples object
def self.cache
@cache ||= begin
serializer = defined?(JSON) ? JSON : YAML
serializer = defined?(Yajl) ? Yajl : YAML
serializer.load(File.read(PATH))
end
end

View File

@@ -242,3 +242,7 @@
# Typesafe Activator
- (^|/)activator$
- (^|/)activator\.bat$
# ProGuard
- proguard.pro
- proguard-rules.pro

View File

@@ -1,3 +1,3 @@
module Linguist
VERSION = "3.4.0"
VERSION = "3.4.1"
end