github-linguist 4.8.17 → 4.8.18

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,225 @@
1
+ {
2
+ "fileTypes": [
3
+ "hamlc"
4
+ ],
5
+ "foldingStartMarker": "^\\s*([-%#\\:\\.\\w\\=].*)\\s$",
6
+ "foldingStopMarker": "^\\s*$",
7
+ "name": "Coffee Haml",
8
+ "patterns": [
9
+ {
10
+ "captures": {
11
+ "1": {
12
+ "name": "punctuation.definition.prolog.haml"
13
+ }
14
+ },
15
+ "match": "^(!!!)($|\\s.*)",
16
+ "name": "meta.prolog.haml"
17
+ },
18
+ {
19
+ "captures": {
20
+ "1": {
21
+ "name": "punctuation.section.comment.haml"
22
+ }
23
+ },
24
+ "match": "^ *(/)\\s*\\S.*$\\n?",
25
+ "name": "comment.line.slash.haml"
26
+ },
27
+ {
28
+ "begin": "^( *)(/)\\s*$",
29
+ "beginCaptures": {
30
+ "2": {
31
+ "name": "punctuation.section.comment.haml"
32
+ }
33
+ },
34
+ "end": "^(?! *$|\\1 )",
35
+ "name": "comment.block.haml",
36
+ "patterns": [
37
+ {
38
+ "include": "text.haml"
39
+ }
40
+ ]
41
+ },
42
+ {
43
+ "begin": "^\\s*(?:((%)([\\w:-]+))|(?=\\.|#))",
44
+ "captures": {
45
+ "1": {
46
+ "name": "meta.tag.haml"
47
+ },
48
+ "2": {
49
+ "name": "punctuation.definition.tag.haml"
50
+ },
51
+ "3": {
52
+ "name": "entity.name.tag.haml"
53
+ }
54
+ },
55
+ "end": "$|(?!\\.|#|\\{|\\[|\\(|=|-|~|/)",
56
+ "patterns": [
57
+ {
58
+ "match": "\\.[\\w-]+",
59
+ "name": "entity.name.tag.class.haml"
60
+ },
61
+ {
62
+ "match": "#[\\w-]+",
63
+ "name": "entity.name.tag.id.haml"
64
+ },
65
+ {
66
+ "begin": "\\{(?=.*\\}|.*(\\||,)\\s*$)",
67
+ "end": "(\\}$|\\}(\\s+)?\\|(\\s+)?$)",
68
+ "name": "meta.section.attributes.haml",
69
+ "patterns": [
70
+ {
71
+ "include": "source.coffee"
72
+ },
73
+ {
74
+ "include": "#continuation"
75
+ }
76
+ ]
77
+ },
78
+ {
79
+ "begin": "\\(|\\((?=.*\\)|.*\\|\\s*$)",
80
+ "end": "\\)",
81
+ "name": "meta.section.attributes.haml",
82
+ "patterns": [
83
+ {
84
+ "include": "#tag-stuff"
85
+ },
86
+ {
87
+ "include": "source.coffee"
88
+ }
89
+ ]
90
+ },
91
+ {
92
+ "begin": "\\[(?=.*\\]|.*\\|\\s*$)",
93
+ "end": "\\]|$|^(?!.*\\|\\s*$)",
94
+ "name": "meta.section.object.haml",
95
+ "patterns": [
96
+ {
97
+ "include": "source.coffee"
98
+ },
99
+ {
100
+ "include": "#continuation"
101
+ }
102
+ ]
103
+ },
104
+ {
105
+ "include": "#coffeeline"
106
+ },
107
+ {
108
+ "match": "/",
109
+ "name": "punctuation.terminator.tag.haml"
110
+ }
111
+ ]
112
+ },
113
+ {
114
+ "captures": {
115
+ "1": {
116
+ "name": "meta.escape.haml"
117
+ }
118
+ },
119
+ "match": "^\\s*(\\\\.)"
120
+ },
121
+ {
122
+ "begin": "^\\s*(?==|-|~)",
123
+ "end": "$",
124
+ "patterns": [
125
+ {
126
+ "include": "#coffeeline"
127
+ }
128
+ ]
129
+ },
130
+ {
131
+ "begin": "^(\\s*)(:css)",
132
+ "beginCaptures": {
133
+ "2": {
134
+ "name": "entity.name.tag.haml"
135
+ }
136
+ },
137
+ "end": "^(?! *$|\\1 )",
138
+ "name": "source.css.embedded.html",
139
+ "patterns": [
140
+ {
141
+ "include": "source.css"
142
+ }
143
+ ]
144
+ },
145
+ {
146
+ "begin": "^(\\s*)(:javascript)",
147
+ "beginCaptures": {
148
+ "2": {
149
+ "name": "entity.name.tag.haml"
150
+ }
151
+ },
152
+ "end": "^(?! *$|\\1 )",
153
+ "name": "source.js.embedded.html",
154
+ "patterns": [
155
+ {
156
+ "include": "source.js"
157
+ }
158
+ ]
159
+ },
160
+ {
161
+ "begin": "#{",
162
+ "captures": {
163
+ "0": {
164
+ "name": "punctuation.section.embedded.coffee"
165
+ }
166
+ },
167
+ "end": "}",
168
+ "name": "source.coffee.embedded.html",
169
+ "patterns": [
170
+ {
171
+ "include": "source.coffee"
172
+ }
173
+ ]
174
+ }
175
+ ],
176
+ "repository": {
177
+ "continuation": {
178
+ "captures": {
179
+ "1": {
180
+ "name": "punctuation.separator.continuation.haml"
181
+ }
182
+ },
183
+ "match": "(\\|,)\\s*\\n"
184
+ },
185
+ "coffeeline": {
186
+ "begin": "=|-|~",
187
+ "contentName": "source.coffee.embedded.haml",
188
+ "end": "((do|\\{)( \\|[^|]+\\|)?)$|$|^(?!.*\\|\\s*$)",
189
+ "endCaptures": {
190
+ "1": {
191
+ "name": "source.coffee.embedded.html"
192
+ },
193
+ "2": {
194
+ "name": "keyword.control.coffee.start-block"
195
+ }
196
+ },
197
+ "name": "meta.line.coffee.haml",
198
+ "patterns": [
199
+ {
200
+ "comment": "Hack to let coffee comments work in this context properly",
201
+ "match": "#.*$",
202
+ "name": "comment.line.number-sign.coffee"
203
+ },
204
+ {
205
+ "include": "source.coffee"
206
+ },
207
+ {
208
+ "include": "#continuation"
209
+ }
210
+ ]
211
+ },
212
+ "tag-generic-attribute": {
213
+ "match": "\\b([a-zA-Z\\-:]+)",
214
+ "name": "entity.other.attribute-name.haml"
215
+ },
216
+ "tag-stuff": {
217
+ "patterns": [
218
+ {
219
+ "include": "#tag-generic-attribute"
220
+ }
221
+ ]
222
+ }
223
+ },
224
+ "scopeName": "text.hamlc"
225
+ }
@@ -0,0 +1,212 @@
1
+ {
2
+ "name": "Spline Font Database",
3
+ "scopeName": "text.sfd",
4
+ "fileTypes": [
5
+ "sfd"
6
+ ],
7
+ "firstLineMatch": "^SplineFontDB: [\\d.]+",
8
+ "patterns": [
9
+ {
10
+ "include": "#main"
11
+ }
12
+ ],
13
+ "repository": {
14
+ "main": {
15
+ "patterns": [
16
+ {
17
+ "include": "#punctuation"
18
+ },
19
+ {
20
+ "include": "#private"
21
+ },
22
+ {
23
+ "include": "#image"
24
+ },
25
+ {
26
+ "include": "#pickleData"
27
+ },
28
+ {
29
+ "include": "#sections"
30
+ },
31
+ {
32
+ "include": "#copyright"
33
+ },
34
+ {
35
+ "include": "#property"
36
+ },
37
+ {
38
+ "include": "#control"
39
+ },
40
+ {
41
+ "include": "#address"
42
+ },
43
+ {
44
+ "include": "#encoding"
45
+ },
46
+ {
47
+ "include": "source.fontforge#shared"
48
+ },
49
+ {
50
+ "include": "#colour"
51
+ }
52
+ ]
53
+ },
54
+ "punctuation": {
55
+ "patterns": [
56
+ {
57
+ "match": "<|>",
58
+ "name": "punctuation.definition.brackets.angle.sfd"
59
+ },
60
+ {
61
+ "match": "[{}]",
62
+ "name": "punctuation.definition.brackets.curly.sfd"
63
+ }
64
+ ]
65
+ },
66
+ "private": {
67
+ "name": "meta.section.private.sfd",
68
+ "begin": "^BeginPrivate(?=:)",
69
+ "end": "^EndPrivate\\b",
70
+ "beginCaptures": {
71
+ "0": {
72
+ "name": "keyword.control.begin.private.sfd"
73
+ }
74
+ },
75
+ "endCaptures": {
76
+ "0": {
77
+ "name": "keyword.control.end.private.sfd"
78
+ }
79
+ },
80
+ "patterns": [
81
+ {
82
+ "match": "^\\S+",
83
+ "name": "entity.name.private.property.sfd"
84
+ },
85
+ {
86
+ "include": "$self"
87
+ }
88
+ ]
89
+ },
90
+ "image": {
91
+ "name": "meta.image.sfd",
92
+ "begin": "^(Image)(?=:)(.+)$",
93
+ "end": "^(EndImage)\\b",
94
+ "contentName": "string.unquoted.raw.data.sfd",
95
+ "beginCaptures": {
96
+ "1": {
97
+ "name": "keyword.control.begin.image.sfd"
98
+ },
99
+ "2": {
100
+ "patterns": [
101
+ {
102
+ "include": "$self"
103
+ }
104
+ ]
105
+ }
106
+ },
107
+ "endCaptures": {
108
+ "1": {
109
+ "name": "keyword.control.end.image.sfd"
110
+ }
111
+ }
112
+ },
113
+ "pickleData": {
114
+ "name": "meta.pickle-data.sfd",
115
+ "begin": "^(PickledData)(:)\\s*(\")",
116
+ "end": "\"",
117
+ "beginCaptures": {
118
+ "1": {
119
+ "name": "entity.name.property.sfd"
120
+ },
121
+ "2": {
122
+ "name": "punctuation.separator.dictionary.key-value.sfd"
123
+ },
124
+ "3": {
125
+ "name": "punctuation.definition.string.begin.sfd"
126
+ }
127
+ },
128
+ "endCaptures": {
129
+ "0": {
130
+ "name": "punctuation.definition.string.end.sfd"
131
+ }
132
+ },
133
+ "patterns": [
134
+ {
135
+ "match": "\\\\.",
136
+ "name": "constant.character.escape.sfd"
137
+ }
138
+ ]
139
+ },
140
+ "sections": {
141
+ "name": "meta.section.${2:/downcase}.sfd",
142
+ "begin": "^(Start|Begin)([A-Z]\\w+)(?=:)",
143
+ "end": "^(End\\2)\\b",
144
+ "beginCaptures": {
145
+ "0": {
146
+ "name": "keyword.control.begin.${2:/downcase}.sfd"
147
+ }
148
+ },
149
+ "endCaptures": {
150
+ "0": {
151
+ "name": "keyword.control.end.${2:/downcase}.sfd"
152
+ }
153
+ },
154
+ "patterns": [
155
+ {
156
+ "include": "$self"
157
+ }
158
+ ]
159
+ },
160
+ "control": {
161
+ "name": "keyword.control.${1:/downcase}.sfd",
162
+ "match": "\\b(Fore|Back|SplineSet|^End\\w+)\\b"
163
+ },
164
+ "colour": {
165
+ "name": "constant.other.hex.colour.sfd",
166
+ "match": "(#)[A-Fa-f0-9]{3,}|(?<=\\s)[A-Fa-f0-9]{6,8}",
167
+ "captures": {
168
+ "1": {
169
+ "name": "punctuation.definition.colour.sfd"
170
+ }
171
+ }
172
+ },
173
+ "encoding": {
174
+ "name": "constant.language.encoding.sfd",
175
+ "match": "(?i)\\b(ISO[-\\w]+)(?<=\\d)(?=\\s|$)"
176
+ },
177
+ "copyright": {
178
+ "name": "meta.${1:/downcase}-string.sfd",
179
+ "begin": "^(Copyright|U?Comments?|\\w+Name)(:)",
180
+ "end": "$",
181
+ "beginCaptures": {
182
+ "1": {
183
+ "name": "entity.name.property.sfd"
184
+ },
185
+ "2": {
186
+ "name": "punctuation.separator.dictionary.key-value.sfd"
187
+ }
188
+ },
189
+ "patterns": [
190
+ {
191
+ "include": "source.fontforge#stringEscapes"
192
+ }
193
+ ]
194
+ },
195
+ "address": {
196
+ "match": "\\d+[xX][A-Fa-f0-9]+",
197
+ "name": "constant.numeric.hexadecimal.sfd"
198
+ },
199
+ "property": {
200
+ "match": "^([^:]+)(:)",
201
+ "name": "meta.dictionary.key-value.sfd",
202
+ "captures": {
203
+ "1": {
204
+ "name": "entity.name.property.sfd"
205
+ },
206
+ "2": {
207
+ "name": "punctuation.separator.dictionary.key-value.sfd"
208
+ }
209
+ }
210
+ }
211
+ }
212
+ }
data/lib/linguist/blob.rb CHANGED
@@ -63,7 +63,7 @@ module Linguist
63
63
  #
64
64
  # Returns an Array
65
65
  def extensions
66
- _, *segments = name.downcase.split(".")
66
+ _, *segments = name.downcase.split(".", -1)
67
67
 
68
68
  segments.map.with_index do |segment, index|
69
69
  "." + segments[index..-1].join(".")
@@ -275,16 +275,14 @@ module Linguist
275
275
  return lines[0].include?("Generated by the protocol buffer compiler. DO NOT EDIT!")
276
276
  end
277
277
 
278
- APACHE_THRIFT_EXTENSIONS = ['.rb', '.py', '.go', '.js', '.m', '.java', '.h', '.cc', '.cpp']
278
+ APACHE_THRIFT_EXTENSIONS = ['.rb', '.py', '.go', '.js', '.m', '.java', '.h', '.cc', '.cpp', '.php']
279
279
 
280
280
  # Internal: Is the blob generated by Apache Thrift compiler?
281
281
  #
282
282
  # Returns true or false
283
283
  def generated_apache_thrift?
284
284
  return false unless APACHE_THRIFT_EXTENSIONS.include?(extname)
285
- return false unless lines.count > 1
286
-
287
- return lines[0].include?("Autogenerated by Thrift Compiler") || lines[1].include?("Autogenerated by Thrift Compiler")
285
+ return lines.first(6).any? { |l| l.include?("Autogenerated by Thrift Compiler") }
288
286
  end
289
287
 
290
288
  # Internal: Is the blob a C/C++ header generated by the Java JNI tool javah?