Compare commits

..

13 Commits

Author SHA1 Message Date
Brandon Black
f7fe1fee66 Release v5.0.5 -- part Deux (#3479)
* bumping to v5.0.5

* relaxing rugged version requirement
2017-02-15 21:29:04 -08:00
Brandon Black
94367cc460 Update LICENSE 2017-02-15 14:11:37 -08:00
Phineas
72bec1fddc Update LICENSE Copyright Date to 2017 (#3476) 2017-02-15 14:11:13 -08:00
Brandon Black
4e2eba4ef8 Revert "Release v5.0.5" (#3477) 2017-02-15 12:48:45 -08:00
Colin Seymour
10457b6639 Release v5.0.5 (#3473)
Release v5.0.5

* Update submodules

* Update grammars

* Bump version to 5.0.5

* Relax dependency on rugged

It's probably not wise to depend on a beta version just yet.

* revert php.tmbundle grammar update

One of the changes in 3ed4837b43...010cc1c22c leads to breakage in snippet highlighting on github.com
2017-02-15 11:12:53 +00:00
Colin Seymour
01de40faaa Return early in Classifier.classify if no languages supplied (#3471)
* Return early if no languages supplied

There's no need to tokenise the data when attempting to classify without a limited language scope as no action will be performed when it comes to scoring anyway.

* Add test for empty languages array
2017-02-13 18:22:54 +00:00
Paul Chaignon
62d285fce6 Fix head commit for TXL grammar (#3470) 2017-02-13 14:35:38 +01:00
Stefan Stölzle
0056095e8c Add .lkml to LookML (#3454)
* Add .lkml to LookML

* Limit .lkml to .view.lkml and .model.lkml

* Add lkml samples

* Fix extension order
2017-02-03 11:50:30 +01:00
Lars Brinkhoff
d6dc3a3991 Accomodate Markdown lines which begin with '>'. (#3452) 2017-02-02 11:58:52 -08:00
Greg Zimmerman
b524461b7c Add PowerShell color. Matches default console color for PowerShell. (#3448) 2017-02-02 11:13:01 -08:00
fix-fix
76d41697aa Use official HTML primary color (#3447)
Use primary color of HTML5 logo as defined on Logo FAQ page
2017-02-02 11:09:55 -08:00
John Gardner
32147b629e Register "Emakefile" as an Erlang filename (#3443) 2017-02-02 11:09:07 -08:00
John Gardner
e7b5e25bf8 Add support for regular expression data (#3441) 2017-02-02 11:08:20 -08:00
21 changed files with 306 additions and 11 deletions

3
.gitmodules vendored
View File

@@ -815,3 +815,6 @@
[submodule "vendor/grammars/language-css"]
path = vendor/grammars/language-css
url = https://github.com/atom/language-css
[submodule "vendor/grammars/language-regexp"]
path = vendor/grammars/language-regexp
url = https://github.com/Alhadis/language-regexp

View File

@@ -1,4 +1,4 @@
Copyright (c) 2011-2016 GitHub, Inc.
Copyright (c) 2017 GitHub, Inc.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation

View File

@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
s.add_dependency 'charlock_holmes', '~> 0.7.3'
s.add_dependency 'escape_utils', '~> 1.1.0'
s.add_dependency 'mime-types', '>= 1.19'
s.add_dependency 'rugged', '0.25.1.1'
s.add_dependency 'rugged', '>= 0.25.1'
s.add_development_dependency 'minitest', '>= 5.0'
s.add_development_dependency 'mocha'

View File

@@ -415,6 +415,10 @@ vendor/grammars/language-povray:
vendor/grammars/language-python:
- text.python.console
- text.python.traceback
vendor/grammars/language-regexp:
- source.regexp
- source.regexp.comment
- source.regexp.extended
vendor/grammars/language-renpy:
- source.renpy
vendor/grammars/language-restructuredtext:

View File

@@ -95,7 +95,7 @@ module Linguist
# Returns sorted Array of result pairs. Each pair contains the
# String language name and a Float score.
def classify(tokens, languages)
return [] if tokens.nil?
return [] if tokens.nil? || languages.empty?
tokens = Tokenizer.tokenize(tokens) if tokens.is_a?(String)
scores = {}

View File

@@ -260,7 +260,7 @@ module Linguist
end
disambiguate ".md" do |data|
if /(^[-a-z0-9=#!\*\[|])|<\//i.match(data) || data.empty?
if /(^[-a-z0-9=#!\*\[|>])|<\//i.match(data) || data.empty?
Language["Markdown"]
elsif /^(;;|\(define_)/.match(data)
Language["GCC machine description"]

View File

@@ -1156,6 +1156,7 @@ Erlang:
- ".xrl"
- ".yrl"
filenames:
- Emakefile
- rebar.config
- rebar.config.lock
- rebar.lock
@@ -1605,7 +1606,7 @@ HTML:
ace_mode: html
codemirror_mode: htmlmixed
codemirror_mime_type: text/html
color: "#e44b23"
color: "#e34c26"
aliases:
- xhtml
extensions:
@@ -2291,6 +2292,8 @@ LookML:
color: "#652B81"
extensions:
- ".lookml"
- ".model.lkml"
- ".view.lkml"
tm_scope: source.yaml
language_id: 211
LoomScript:
@@ -3226,6 +3229,7 @@ PowerBuilder:
language_id: 292
PowerShell:
type: programming
color: "#012456"
ace_mode: powershell
codemirror_mode: powershell
codemirror_mime_type: application/x-powershell
@@ -3601,6 +3605,17 @@ Redcode:
tm_scope: none
ace_mode: text
language_id: 321
Regular Expression:
type: data
extensions:
- ".regexp"
- ".regex"
aliases:
- regexp
- regex
ace_mode: text
tm_scope: source.regexp
language_id: 363378884
Ren'Py:
type: programming
aliases:
@@ -4298,6 +4313,7 @@ Text:
- ".no"
filenames:
- COPYING
- COPYRIGHT.regex
- FONTLOG
- INSTALL
- INSTALL.mysql
@@ -4597,9 +4613,9 @@ XCompose:
type: data
filenames:
- ".XCompose"
- "XCompose"
- "xcompose"
tm_scope: 'config.xcompose'
- XCompose
- xcompose
tm_scope: config.xcompose
ace_mode: text
language_id: 225167241
XML:

View File

@@ -1,3 +1,3 @@
module Linguist
VERSION = "5.0.4"
VERSION = "5.0.5"
end

View File

@@ -0,0 +1,7 @@
{"src/*", [
report,
verbose,
{i, "include"},
{outdir, "ebin"},
debug_info
]}.

View File

@@ -0,0 +1,49 @@
- label: 'desired label name'
- connection: connection_name
- include: filename_or_pattern
# Possibly more include declarations
- persist_for: N (seconds | minutes | hours)
- case_sensitive: true | false
- week_start_day: monday | tuesday | wednesday | thursday | friday | saturday | sunday
- value_formats:
- name: desired_format_name
value_format: 'excel-style formatting string'
# Possibly more value formats
- explore: view_name
label: 'desired label name'
description: 'description string'
symmetric_aggregates: true | false
hidden: true | false
fields: [field_or_set, field_or_set, …]
sql_always_where: SQL WHERE condition
always_filter:
field_name: 'looker filter expression'
conditionally_filter:
field_name: 'looker filter expression'
unless: [field_or_set, field_or_set, …]
access_filter_fields: [fully_scoped_field, fully_scoped_field, …]
always_join: [view_name, view_name, …]
joins:
- join: view_name
type: left_outer | full_outer | inner | cross
relationship: one_to_one | many_to_one | one_to_many | many_to_many
from: view_name
sql_table_name: table_name
view_label: 'desired label name'
fields: [field_or_set, field_or_set, …]
required_joins: [view_name, view_name, …]
foreign_key: dimension_name
sql_on: SQL ON clause
# Possibly more join declarations
persist_for: N (seconds | minutes | hours)
from: view_name
view: view_name
case_sensitive: true | false
sql_table_name: table_name
cancel_grouping_fields: [fully_scoped_field, fully_scoped_field, …]
# Possibly more explore declarations

View File

@@ -0,0 +1,90 @@
- view: view_name
sql_table_name: table_name
suggestions: true | false
derived_table:
sql: SQL query
persist_for: N (seconds | minutes | hours)
sql_trigger_value: SQL query
distribution: column_name
distribution_style: ALL | EVEN
sortkeys: [column_name, column_name, …]
indexes: [column_name, column_name, …]
sets:
set_name:
- field_or_set
- field_or_set
- …
# Possibly more set declarations
fields:
- (dimension | dimension_group | measure | filter): field_name
label: 'desired label name'
view_label: 'desired label name'
group_label: 'desired label name'
description: 'description string'
hidden: true | false
alias: [old_field_name, old_field_name, …]
value_format: 'excel-style formatting string'
value_format_name: format_name
html: HTML expression using Liquid template elements
sql: SQL expression to generate the field value
required_fields: [field_name, field_name, …]
drill_fields: [field_or_set, field_or_set, …]
can_filter: true | false
fanout_on: repeated_record_name
# DIMENSION SPECIFIC PARAMETERS
type: dimension_field_type
primary_key: true | false
sql_case:
value: SQL condition
value: SQL condition
# Possibly more sql_case statements
alpha_sort: true | false
tiers: [N, N, …]
style: classic | interval | integer | relational
sql_latitude: SQL expression to generate a latitude
sql_longitude: SQL expression to generate a longitude
suggestable: true | false
suggest_persist_for: N (seconds | minutes | hours)
suggest_dimension: dimension_name
suggest_explore: explore_name
suggestions: ['suggestion string', 'suggestion string', …]
bypass_suggest_restrictions: true | false
full_suggestions: true | false
skip_drill_filter: true | false
case_sensitive: true | false
order_by_field: dimension_name
map_layer: name_of_map_layer
links:
- label: 'desired label name'
url: desired_url
icon_url: url_of_an_ico_file
# Possibly more links
# DIMENSION GROUP SPECIFIC PARAMETERS
timeframes: [timeframe, timeframe, …]
convert_tz: true | false
datatype: epoch | timestamp | datetime | date | yyyymmdd
# MEASURE SPECIFIC PARAMETERS
type: measure_field_type
direction: row | column
approximate: true | false
approximate_threshold: N
sql_distinct_key: SQL expression to define repeated entities
list_field: dimension_name
filters:
dimension_name: 'looker filter expression'
# Possibly more filters statements
# FILTER SPECIFIC PARAMETERS
default_value: 'desired default value'
# Possibly more dimension or measure declarations

View File

@@ -0,0 +1,19 @@
-\*-
(?:
\s*
(?= [^:;\s]+ \s* -\*-)
|
(?:
.*?[;\s]
|
(?<=-\*-)
)
mode\s*:\s*
)
([^:;\s]+)
(?=
[\s;] | (?<![-*]) -\*-
)
.*?
-\*-

View File

@@ -0,0 +1,27 @@
(?:
(?:\s|^)
vi
(?:m[<=>]?\d+|m)?
|
[\t\x20]
ex
)
(?=
: (?=\s* set? \s [^\n:]+ :) |
: (?!\s* set? \s)
)
(?:
(?:\s|\s*:\s*)
\w*
(?:
\s*=
(?:[^\n\\\s]|\\.)*
)?
)*
[\s:]
(?:filetype|ft|syntax)
\s*=
(MODE_NAME_HERE)
(?=\s|:|$)

View File

@@ -0,0 +1 @@
\b(\d*1[1-3]th|\d*0th|(?:(?!11st)\d)*1st|\d*2nd|(?:(?!13rd)\d*)3rd|\d*[4-9]th)\b

View File

@@ -0,0 +1 @@
/^([^\/#\?]*:?\/\/)?(\/?(?:[^\/#\?]+\/)*)?([^\/#\?]+)?(?:\/(?=$))?(\?[^#]*)?(#.*)?$/

View File

@@ -0,0 +1,54 @@
$OpenBSD: COPYRIGHT,v 1.3 2003/06/02 20:18:36 millert Exp $
Copyright 1992, 1993, 1994 Henry Spencer. All rights reserved.
This software is not subject to any license of the American Telephone
and Telegraph Company or of the Regents of the University of California.
Permission is granted to anyone to use this software for any purpose on
any computer system, and to alter it and redistribute it, subject
to the following restrictions:
1. The author is not responsible for the consequences of use of this
software, no matter how awful, even if they arise from flaws in it.
2. The origin of this software must not be misrepresented, either by
explicit claim or by omission. Since few users ever read sources,
credits must appear in the documentation.
3. Altered versions must be plainly marked as such, and must not be
misrepresented as being the original software. Since few users
ever read sources, credits must appear in the documentation.
4. This notice may not be removed or altered.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
/*-
* Copyright (c) 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)COPYRIGHT 8.1 (Berkeley) 3/16/94
*/

View File

@@ -53,4 +53,8 @@ class TestClassifier < Minitest::Test
assert_equal language.name, results.first[0], "#{sample[:path]}\n#{results.inspect}"
end
end
def test_classify_empty_languages
assert_equal [], Classifier.classify(Samples.cache, fixture("Ruby/foo.rb"), [])
end
end

3
vendor/README.md vendored
View File

@@ -84,7 +84,7 @@ This is a list of grammars that Linguist selects to provide syntax highlighting
- **D-ObjDump:** [nanoant/assembly.tmbundle](https://github.com/nanoant/assembly.tmbundle)
- **Dart:** [guillermooo/dart-sublime-bundle](https://github.com/guillermooo/dart-sublime-bundle)
- **desktop:** [Mailaender/desktop.tmbundle](https://github.com/Mailaender/desktop.tmbundle)
- **Diff:** [kivikakk/diff.tmbundle](https://github.com/kivikakk/diff.tmbundle)
- **Diff:** [textmate/diff.tmbundle](https://github.com/textmate/diff.tmbundle)
- **DM:** [PJB3005/atomic-dreams](https://github.com/PJB3005/atomic-dreams)
- **DNS Zone:** [sixty4k/st2-zonefile](https://github.com/sixty4k/st2-zonefile)
- **Dockerfile:** [asbjornenge/Docker.tmbundle](https://github.com/asbjornenge/Docker.tmbundle)
@@ -278,6 +278,7 @@ This is a list of grammars that Linguist selects to provide syntax highlighting
- **Reason:** [facebook/reason](https://github.com/facebook/reason)
- **Rebol:** [Oldes/Sublime-REBOL](https://github.com/Oldes/Sublime-REBOL)
- **Red:** [Oldes/Sublime-Red](https://github.com/Oldes/Sublime-Red)
- **Regular Expression:** [Alhadis/language-regexp](https://github.com/Alhadis/language-regexp)
- **Ren'Py:** [williamd1k0/language-renpy](https://github.com/williamd1k0/language-renpy)
- **reStructuredText:** [Lukasa/language-restructuredtext](https://github.com/Lukasa/language-restructuredtext)
- **REXX:** [mblocker/rexx-sublime](https://github.com/mblocker/rexx-sublime)

View File

@@ -0,0 +1,18 @@
---
type: grammar
name: language-regexp
license: isc
---
Copyright (c) 2016-2017, John Gardner
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.