mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-12-08 20:38:47 +00:00
Merge master
This commit is contained in:
@@ -53,7 +53,7 @@ module Linguist
|
||||
|
||||
# Internal: Check if this heuristic matches the candidate languages.
|
||||
def matches?(candidates)
|
||||
candidates.all? { |l| @languages.include?(l.name) }
|
||||
candidates.any? && candidates.all? { |l| @languages.include?(l.name) }
|
||||
end
|
||||
|
||||
# Internal: Perform the heuristic
|
||||
@@ -70,8 +70,10 @@ module Linguist
|
||||
end
|
||||
end
|
||||
|
||||
disambiguate "Perl", "Prolog" do |data|
|
||||
if data.include?("use strict")
|
||||
disambiguate "Perl", "Perl6", "Prolog" do |data|
|
||||
if data.include?("use v6")
|
||||
Language["Perl6"]
|
||||
elsif data.include?("use strict")
|
||||
Language["Perl"]
|
||||
elsif data.include?(":-")
|
||||
Language["Prolog"]
|
||||
@@ -144,6 +146,15 @@ module Linguist
|
||||
|
||||
disambiguate "Gosu", "JavaScript" do |data|
|
||||
Language["Gosu"] if /^uses java\./.match(data)
|
||||
end
|
||||
end
|
||||
|
||||
disambiguate "LoomScript", "LiveScript" do |data|
|
||||
if /^\s*package\s*[\w\.\/\*\s]*\s*{/.match(data)
|
||||
Language["LoomScript"]
|
||||
else
|
||||
Language["LiveScript"]
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1636,6 +1636,12 @@ LookML:
|
||||
- .lookml
|
||||
tm_scope: source.yaml
|
||||
|
||||
LoomScript:
|
||||
type: programming
|
||||
extensions:
|
||||
- .ls
|
||||
tm_scope: source.loomscript
|
||||
|
||||
Lua:
|
||||
type: programming
|
||||
ace_mode: lua
|
||||
@@ -1878,11 +1884,12 @@ Nit:
|
||||
|
||||
Nix:
|
||||
type: programming
|
||||
color: "#7070ff"
|
||||
extensions:
|
||||
- .nix
|
||||
aliases:
|
||||
- nixos
|
||||
tm_scope: none
|
||||
tm_scope: source.nix
|
||||
ace_mode: nix
|
||||
|
||||
Nu:
|
||||
@@ -2040,7 +2047,7 @@ Oxygene:
|
||||
- .oxygene
|
||||
tm_scope: none
|
||||
ace_mode: none
|
||||
|
||||
|
||||
Oz:
|
||||
type: programming
|
||||
color: "#fcaf3e"
|
||||
@@ -2067,7 +2074,6 @@ PHP:
|
||||
- .aw
|
||||
- .ctp
|
||||
- .fcgi
|
||||
- .module
|
||||
- .php3
|
||||
- .php4
|
||||
- .php5
|
||||
@@ -2161,14 +2167,17 @@ Perl6:
|
||||
type: programming
|
||||
color: "#0298c3"
|
||||
extensions:
|
||||
- .p6
|
||||
- .6pl
|
||||
- .6pm
|
||||
- .nqp
|
||||
- .p6
|
||||
- .p6l
|
||||
- .p6m
|
||||
- .pl
|
||||
- .pl6
|
||||
- .pm
|
||||
- .pm6
|
||||
- .t
|
||||
interpreters:
|
||||
- perl6
|
||||
tm_scope: none
|
||||
|
||||
@@ -19,7 +19,7 @@ module Linguist
|
||||
# Returns a String or nil
|
||||
def self.interpreter(data)
|
||||
lines = data.lines
|
||||
return unless match = /^#! ?(.*)$/.match(lines.first)
|
||||
return unless match = /^#! ?(.+)$/.match(lines.first)
|
||||
|
||||
tokens = match[1].split(' ')
|
||||
script = tokens.first.split('/').last
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module Linguist
|
||||
VERSION = "4.0.3"
|
||||
VERSION = "4.2.1"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user