github-linguist 5.3.2 → 5.3.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,7 +11,7 @@
11
11
  #define FLEX_SCANNER
12
12
  #define YY_FLEX_MAJOR_VERSION 2
13
13
  #define YY_FLEX_MINOR_VERSION 5
14
- #define YY_FLEX_SUBMINOR_VERSION 39
14
+ #define YY_FLEX_SUBMINOR_VERSION 35
15
15
  #if YY_FLEX_SUBMINOR_VERSION > 0
16
16
  #define FLEX_BETA
17
17
  #endif
@@ -49,6 +49,7 @@ typedef int16_t flex_int16_t;
49
49
  typedef uint16_t flex_uint16_t;
50
50
  typedef int32_t flex_int32_t;
51
51
  typedef uint32_t flex_uint32_t;
52
+ typedef uint64_t flex_uint64_t;
52
53
  #else
53
54
  typedef signed char flex_int8_t;
54
55
  typedef short int flex_int16_t;
@@ -56,6 +57,7 @@ typedef int flex_int32_t;
56
57
  typedef unsigned char flex_uint8_t;
57
58
  typedef unsigned short int flex_uint16_t;
58
59
  typedef unsigned int flex_uint32_t;
60
+ #endif /* ! C99 */
59
61
 
60
62
  /* Limits of integral types. */
61
63
  #ifndef INT8_MIN
@@ -86,8 +88,6 @@ typedef unsigned int flex_uint32_t;
86
88
  #define UINT32_MAX (4294967295U)
87
89
  #endif
88
90
 
89
- #endif /* ! C99 */
90
-
91
91
  #endif /* ! FLEXINT_H */
92
92
 
93
93
  #ifdef __cplusplus
@@ -130,15 +130,7 @@ typedef void* yyscan_t;
130
130
 
131
131
  /* Size of default input buffer. */
132
132
  #ifndef YY_BUF_SIZE
133
- #ifdef __ia64__
134
- /* On IA-64, the buffer size is 16k, not 8k.
135
- * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
136
- * Ditto for the __ia64__ case accordingly.
137
- */
138
- #define YY_BUF_SIZE 32768
139
- #else
140
133
  #define YY_BUF_SIZE 16384
141
- #endif /* __ia64__ */
142
134
  #endif
143
135
 
144
136
  #ifndef YY_TYPEDEF_YY_BUFFER_STATE
@@ -277,10 +269,6 @@ int linguist_yyget_lineno (yyscan_t yyscanner );
277
269
 
278
270
  void linguist_yyset_lineno (int line_number ,yyscan_t yyscanner );
279
271
 
280
- int linguist_yyget_column (yyscan_t yyscanner );
281
-
282
- void linguist_yyset_column (int column_no ,yyscan_t yyscanner );
283
-
284
272
  /* Macros after this point can all be overridden by user definitions in
285
273
  * section 1.
286
274
  */
@@ -307,12 +295,7 @@ static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
307
295
 
308
296
  /* Amount of stuff to slurp up with each read. */
309
297
  #ifndef YY_READ_BUF_SIZE
310
- #ifdef __ia64__
311
- /* On IA-64, the buffer size is 16k, not 8k */
312
- #define YY_READ_BUF_SIZE 16384
313
- #else
314
298
  #define YY_READ_BUF_SIZE 8192
315
- #endif /* __ia64__ */
316
299
  #endif
317
300
 
318
301
  /* Number of entries by which start-condition stack grows. */
@@ -345,9 +328,9 @@ extern int linguist_yylex (yyscan_t yyscanner);
345
328
  #undef YY_DECL
346
329
  #endif
347
330
 
348
- #line 117 "tokenizer.l"
331
+ #line 118 "tokenizer.l"
349
332
 
350
333
 
351
- #line 352 "lex.linguist_yy.h"
334
+ #line 335 "lex.linguist_yy.h"
352
335
  #undef linguist_yyIN_HEADER
353
336
  #endif /* linguist_yyHEADER_H */
@@ -9,25 +9,25 @@
9
9
 
10
10
  #define eat_until_eol() do { \
11
11
  int c; \
12
- while ((c = input(yyscanner)) != '\n' && c != EOF); \
13
- if (c == EOF) \
14
- yyterminate(); \
12
+ while ((c = input(yyscanner)) != '\n' && c != EOF && c); \
13
+ if (c == EOF || !c) \
14
+ return 0; \
15
15
  } while (0)
16
16
 
17
17
  #define eat_until_unescaped(q) do { \
18
18
  int c; \
19
- while ((c = input(yyscanner)) != EOF) { \
19
+ while ((c = input(yyscanner)) != EOF && c) { \
20
20
  if (c == '\n') \
21
21
  break; \
22
22
  if (c == '\\') { \
23
23
  c = input(yyscanner); \
24
- if (c == EOF) \
25
- yyterminate(); \
24
+ if (c == EOF || !c) \
25
+ return 0; \
26
26
  } else if (c == q) \
27
27
  break; \
28
28
  } \
29
- if (c == EOF) \
30
- yyterminate(); \
29
+ if (c == EOF || !c) \
30
+ return 0; \
31
31
  } while (0)
32
32
 
33
33
  %}
@@ -84,7 +84,7 @@
84
84
  \" { eat_until_unescaped('"'); }
85
85
  ' { eat_until_unescaped('\''); }
86
86
  (0x[0-9a-fA-F]([0-9a-fA-F]|\.)*|[0-9]([0-9]|\.)*)([uU][lL]{0,2}|([eE][-+][0-9]*)?[fFlL]*) { /* nothing */ }
87
- \<[^ \t\n\r<>]+/>|" "[^<>\n]{0,2048}> {
87
+ \<[[:alnum:]_!./?-]+ {
88
88
  if (strcmp(yytext, "<!--") == 0) {
89
89
  BEGIN(xml_comment);
90
90
  } else {
@@ -93,8 +93,8 @@
93
93
  return 1;
94
94
  }
95
95
  }
96
- <sgml>[[:alnum:]_]+=/\" { feed_token(strdup(yytext), REGULAR_TOKEN); input(yyscanner); eat_until_unescaped('"'); return 1; }
97
- <sgml>[[:alnum:]_]+=/' { feed_token(strdup(yytext), REGULAR_TOKEN); input(yyscanner); eat_until_unescaped('\''); return 1; }
96
+ <sgml>[[:alnum:]_]+=\" { feed_token(strndup(yytext, strlen(yytext) - 1), REGULAR_TOKEN); eat_until_unescaped('"'); return 1; }
97
+ <sgml>[[:alnum:]_]+=' { feed_token(strndup(yytext, strlen(yytext) - 1), REGULAR_TOKEN); eat_until_unescaped('\''); return 1; }
98
98
  <sgml>[[:alnum:]_]+=[[:alnum:]_]* { feed_token(strdup(yytext), REGULAR_TOKEN); *(strchr(yyextra->token, '=') + 1) = 0; return 1; }
99
99
  <sgml>[[:alnum:]_]+ { feed_token(strdup(yytext), REGULAR_TOKEN); return 1; }
100
100
  <sgml>\> { BEGIN(INITIAL); }
@@ -0,0 +1,52 @@
1
+ {
2
+ "scopeName": "source.julia.console",
3
+ "name": "Julia Console",
4
+ "comment": "Not sure what this will be used for... Maybe if we have a REPL someday",
5
+ "patterns": [
6
+ {
7
+ "match": "^(julia>|\\.{3}|In \\[\\d+\\]:) (.+)$",
8
+ "captures": {
9
+ "1": {
10
+ "name": "punctuation.separator.prompt.julia.console"
11
+ },
12
+ "2": {
13
+ "patterns": [
14
+ {
15
+ "include": "source.julia"
16
+ }
17
+ ]
18
+ }
19
+ }
20
+ },
21
+ {
22
+ "match": "^(shell>) (.+)$",
23
+ "captures": {
24
+ "1": {
25
+ "name": "punctuation.separator.prompt.shell.julia.console"
26
+ },
27
+ "2": {
28
+ "patterns": [
29
+ {
30
+ "include": "source.shell"
31
+ }
32
+ ]
33
+ }
34
+ }
35
+ },
36
+ {
37
+ "match": "^(help\\?>) (.+)$",
38
+ "captures": {
39
+ "1": {
40
+ "name": "punctuation.separator.prompt.help.julia.console"
41
+ },
42
+ "2": {
43
+ "patterns": [
44
+ {
45
+ "include": "source.julia"
46
+ }
47
+ ]
48
+ }
49
+ }
50
+ }
51
+ ]
52
+ }
@@ -1,15 +1,13 @@
1
1
  {
2
- "comment": "\n\tTODO:\n\t* syntax types, tuple types, union\n\t* take out ::Type\n\t",
2
+ "comment": "Reference to the Oniguruma Regex libraray:\n https://github.com/kkos/oniguruma/blob/master/doc/RE\n\nTODO:\n* Once 0.4 is released, simplify type matches (no explicit 'Union', parens, etc.)\n* take out ::Type\n* Add more regex stuff.\n* Some in comments throughout the grammar\n",
3
3
  "fileTypes": [
4
4
  "jl"
5
5
  ],
6
6
  "firstLineMatch": "^#!.*\\bjulia\\s*$",
7
- "keyEquivalent": "^~J",
7
+ "foldingStartMarker": "^\\s*(?:if|while|for|begin|function|macro|module|baremodule|type|immutable|struct|try|let)\\b(?!.*\\bend\\b).*$",
8
+ "foldingStopMarker": "^\\s*(?:end)\\b.*$",
8
9
  "name": "Julia",
9
10
  "patterns": [
10
- {
11
- "include": "#symbol"
12
- },
13
11
  {
14
12
  "include": "#operator"
15
13
  },
@@ -22,9 +20,6 @@
22
20
  {
23
21
  "include": "#bracket"
24
22
  },
25
- {
26
- "include": "#type_decl"
27
- },
28
23
  {
29
24
  "include": "#function_decl"
30
25
  },
@@ -39,6 +34,12 @@
39
34
  },
40
35
  {
41
36
  "include": "#comment"
37
+ },
38
+ {
39
+ "include": "#type_decl"
40
+ },
41
+ {
42
+ "include": "#symbol"
42
43
  }
43
44
  ],
44
45
  "repository": {
@@ -91,12 +92,13 @@
91
92
  "name": "comment.block.number-sign-equals.julia"
92
93
  },
93
94
  {
94
- "captures": {
95
- "1": {
95
+ "begin": "#",
96
+ "beginCaptures": {
97
+ "0": {
96
98
  "name": "punctuation.definition.comment.julia"
97
99
  }
98
100
  },
99
- "match": "(?<!\\$)(#)(?!\\{).*$\\n?",
101
+ "end": "\\n",
100
102
  "name": "comment.line.number-sign.julia"
101
103
  }
102
104
  ]
@@ -104,10 +106,13 @@
104
106
  "function_call": {
105
107
  "patterns": [
106
108
  {
107
- "begin": "([a-zA-Z0-9_]+!?)\\w*\\(",
109
+ "begin": "([[:alpha:]_][[:word:]⁺-ₜ!′]*)({(?:[^{}]|{(?:[^{}]|{[^{}]*})*})*})?\\.?\\(",
108
110
  "beginCaptures": {
109
111
  "1": {
110
112
  "name": "support.function.julia"
113
+ },
114
+ "2": {
115
+ "name": "support.type.julia"
111
116
  }
112
117
  },
113
118
  "end": "\\)(('|(\\.'))*\\.?')?",
@@ -135,7 +140,8 @@
135
140
  "name": "support.type.julia"
136
141
  }
137
142
  },
138
- "match": "([\\w.!]+)({[^}]*})?\\((?=.*\\)\\s*=(?!=))"
143
+ "match": "([[:alpha:]_][[:word:]⁺-ₜ!′]*)({(?:[^{}]|{(?:[^{}]|{[^{}]*})*})*})?\\((?=.*\\)(::[^\\s]+)?(\\s*\\bwhere\\b\\s*[^\\s]+)?\\s*?=(?![=>]))",
144
+ "comment": "This is different from the one in tpoisot's package"
139
145
  },
140
146
  {
141
147
  "captures": {
@@ -143,40 +149,68 @@
143
149
  "name": "keyword.other.julia"
144
150
  },
145
151
  "2": {
146
- "name": "entity.name.function.julia"
152
+ "name": "keyword.operator.dots.julia"
147
153
  },
148
154
  "3": {
155
+ "name": "entity.name.function.julia"
156
+ },
157
+ "4": {
149
158
  "name": "support.type.julia"
150
159
  }
151
160
  },
152
- "match": "\\b(function|macro)\\s+([\\w.!]+)({[^}]*})?\\("
161
+ "match": "\\b(function|macro)\\s+(?:[[:alpha:]_][[:word:]⁺-ₜ!′]*(\\.))?([[:alpha:]_][[:word:]⁺-ₜ!′]*)({(?:[^{}]|{(?:[^{}]|{[^{}]*})*})*})?\\(",
162
+ "comment": "similar regex to previous, but with keyword not 1-line syntax"
153
163
  }
154
164
  ]
155
165
  },
156
166
  "keyword": {
157
167
  "patterns": [
158
168
  {
159
- "match": "\\b(?:function|(mutable\\s+)?struct|macro|quote|((primitive|abstract)\\s+)?type|immutable|module|baremodule|new|where)\\b",
169
+ "match": "\\b(?<![:_])(?:function|@generated|type|immutable|mutable|struct|macro|quote|abstract|bitstype|typealias|module|baremodule|new|where)\\b",
160
170
  "name": "keyword.other.julia"
161
171
  },
162
172
  {
163
- "match": "\\b(?:if|else|elseif|while|for|in|isa|begin|let|end|do|try|catch|finally|return|break|continue)\\b",
173
+ "match": "\\b(?<![:_])(?:if|else|elseif|while|for|begin|let|do|try|catch|finally|return|break|continue)\\b",
164
174
  "name": "keyword.control.julia"
165
175
  },
166
176
  {
167
- "match": "\\b(?:global|local|const|export|import|importall|using)\\b",
177
+ "match": "\\b(?<![:_])end\\b",
178
+ "name": "keyword.control.end.julia"
179
+ },
180
+ {
181
+ "match": "\\b(?<![:_])(?:global|local|const)\\b",
168
182
  "name": "storage.modifier.variable.julia"
169
183
  },
170
184
  {
171
- "match": "@\\w+\\b",
185
+ "match": "\\b(?<![:_])(?:export)\\b",
186
+ "name": "keyword.control.export.julia"
187
+ },
188
+ {
189
+ "match": "\\b(?<![:_])(?:import)\\b",
190
+ "name": "keyword.control.import.julia"
191
+ },
192
+ {
193
+ "match": "\\b(?<![:_])(?:importall)\\b",
194
+ "name": "keyword.control.importall.julia"
195
+ },
196
+ {
197
+ "match": "\\b(?<![:_])(?:using)\\b",
198
+ "name": "keyword.control.using.julia"
199
+ },
200
+ {
201
+ "match": "(@[[:alpha:]_][[:word:]⁺-ₜ!′]*)",
172
202
  "name": "support.function.macro.julia"
203
+ },
204
+ {
205
+ "match": "\\b(Argument|Assertion|Bounds|Divide|Domain|EOF|Inexact|Key|Load|Memory|Method|OutOfMemory|Overflow|Parse|StackOverflow|System|Type|UV|UndefRef|UndefVar)Error\\b",
206
+ "name": "support.type.exception.julia"
173
207
  }
174
208
  ]
175
209
  },
176
210
  "number": {
177
211
  "patterns": [
178
212
  {
179
- "match": "((\\b0(x|X)[0-9a-fA-F](_?[0-9a-fA-F])*)|(\\b0o[0-7](_?[0-7])*)|(\\b0b[0-1](_?[0-1])*)|((\\b[0-9](_?[0-9])*\\.?(_?[0-9]*))|(\\.[0-9](_?[0-9])*))((e|E)(\\+|-)?(_?[0-9])*)?(im)?|\\bInf(32)?\\b|\\bNaN(32)?\\b)",
213
+ "match": "((\\b0(x|X)[0-9a-fA-F](_?[0-9a-fA-F])*)|(\\b0o[0-7](_?[0-7])*)|(\\b0b[0-1](_?[0-1])*)|((\\b[0-9](_?[0-9])*\\.?(_?[0-9]*))|(\\.[0-9](_?[0-9])*))([eE][+-]?[0-9](_?[0-9])*)?(im)?|\\bInf(32)?\\b|\\bNaN(32)?\\b)",
180
214
  "name": "constant.numeric.julia"
181
215
  },
182
216
  {
@@ -188,51 +222,62 @@
188
222
  "operator": {
189
223
  "patterns": [
190
224
  {
191
- "match": "(?:=|:=|\\+=|-=|\\*=|/=|//=|\\.//=|\\.\\*=|\\\\=|\\.\\\\=|^=|\\.^=|%=|\\|=|&=|\\$=|<<=|>>=)",
225
+ "match": "(?:->|<-|-->|=>)",
226
+ "name": "keyword.operator.arrow.julia"
227
+ },
228
+ {
229
+ "match": "(?::=|\\+=|-=|\\*=|//=|/=|\\.//=|\\./=|\\.\\*=|\\\\=|\\.\\\\=|\\^=|\\.\\^=|%=|\\.%=|÷=|\\.÷=|\\|=|&=|\\$=|<<=|>>=|>>>=|=(?!=))",
192
230
  "name": "keyword.operator.update.julia"
193
231
  },
194
232
  {
195
- "match": "(?:::(?:(?:Union)?\\([^)]*\\)|\\w+(?:{[^}]*})?))(?:\\.\\.\\.)?",
196
- "name": "support.type.julia"
233
+ "match": "(?:<<|>>>|>>|\\.>>>|\\.>>|\\.<<)",
234
+ "name": "keyword.operator.shift.julia"
197
235
  },
198
236
  {
199
- "match": "(?:\\?|:)",
200
- "name": "keyword.operator.ternary.julia"
237
+ "match": "(?:\\s*(::|<:)\\s*((?:(?:Union)?\\([^)]*\\)|[[:alpha:]_][[:word:]⁺-ₜ!′\\.]*(?:{(?:[^{}]|{(?:[^{}]|{[^{}]*})*})*})?)))(?:\\.\\.\\.)?",
238
+ "captures": {
239
+ "1": {
240
+ "name": "keyword.operator.relation.julia"
241
+ },
242
+ "2": {
243
+ "name": "support.type.julia"
244
+ }
245
+ }
201
246
  },
202
247
  {
203
- "match": "(?:\\|\\||&&|!)",
204
- "name": "keyword.operator.boolean.julia"
248
+ "match": "(?:===|(?<=\\s)in(?=\\s)|\\.==|!==|!=|\\.>=|\\.>|\\.<|==|\\.!=|\\.=|\\.!|<:|:>|(?<!>)>=|(?<!<)<=|\\.<=|>|<)",
249
+ "name": "keyword.operator.relation.julia"
205
250
  },
206
251
  {
207
- "match": "(?:->|<-|-->)",
208
- "name": "keyword.operator.arrow.julia"
252
+ "match": "(?:\\?:)",
253
+ "name": "keyword.operator.ternary.julia"
209
254
  },
210
255
  {
211
- "match": "(?:>|<|>=|<=|==|!=|\\.>|\\.<|\\.>=|\\.>=|\\.==|\\.!=|\\.=|\\.!|<:|:>)",
212
- "name": "keyword.operator.relation.julia"
256
+ "match": "(?:\\|\\||&&|(?<![[:word:]])!)",
257
+ "name": "keyword.operator.boolean.julia"
213
258
  },
214
259
  {
215
260
  "match": "(?::)",
216
261
  "name": "keyword.operator.range.julia"
217
262
  },
218
263
  {
219
- "match": "(?:<<|>>)",
220
- "name": "keyword.operator.shift.julia"
264
+ "match": "(?:\\|>)",
265
+ "name": "keyword.operator.applies.julia"
221
266
  },
222
267
  {
223
268
  "match": "(?:\\||\\&|~)",
224
269
  "name": "keyword.operator.bitwise.julia"
225
270
  },
226
271
  {
227
- "match": "(?:\\+|-|\\*|\\.\\*|/|\\./|//|\\.//|%|\\.%|\\\\|\\.\\\\|\\^|\\.\\^)",
272
+ "match": "(?:\\+\\+|--|\\+|\\.\\+|-|\\.\\-|\\*|\\.\\*|//(?!=)|\\.//(?!=)|/|\\./|%|\\.%|\\\\|\\.\\\\|\\^|\\.\\^)",
228
273
  "name": "keyword.operator.arithmetic.julia"
229
274
  },
230
275
  {
231
- "match": "(?:::)",
276
+ "match": "(?:::|(?<=\\s)isa(?=\\s))",
232
277
  "name": "keyword.operator.isa.julia"
233
278
  },
234
279
  {
235
- "match": "(?:\\.(?=[a-zA-Z])|\\.\\.+)",
280
+ "match": "(?:\\.(?=(?:@|_|\\p{L}))|\\.\\.+)",
236
281
  "name": "keyword.operator.dots.julia"
237
282
  },
238
283
  {
@@ -245,12 +290,12 @@
245
290
  "name": "keyword.operator.transposed-variable.julia"
246
291
  }
247
292
  },
248
- "match": "(\\w+)(('|(\\.'))*\\.?')"
293
+ "match": "([[:alpha:]_][[:word:]⁺-ₜ!′]*)(('|(\\.'))*\\.?')"
249
294
  },
250
295
  {
251
296
  "captures": {
252
297
  "1": {
253
- "name": "keyword.bracket.end.julia"
298
+ "name": "bracket.end.julia"
254
299
  },
255
300
  "2": {
256
301
  "name": "keyword.operator.transposed-matrix.julia"
@@ -261,7 +306,7 @@
261
306
  {
262
307
  "captures": {
263
308
  "1": {
264
- "name": "keyword.bracket.end.julia"
309
+ "name": "bracket.end.julia"
265
310
  },
266
311
  "2": {
267
312
  "name": "keyword.operator.transposed-parens.julia"
@@ -273,6 +318,91 @@
273
318
  },
274
319
  "string": {
275
320
  "patterns": [
321
+ {
322
+ "begin": "(i?cxx)(\"\"\")",
323
+ "beginCaptures": {
324
+ "1": {
325
+ "name": "support.function.macro.julia"
326
+ },
327
+ "2": {
328
+ "name": "punctuation.definition.string.begin.julia"
329
+ }
330
+ },
331
+ "end": "\"\"\"",
332
+ "endCaptures": {
333
+ "0": {
334
+ "name": "punctuation.definition.string.end.julia"
335
+ }
336
+ },
337
+ "name": "embed.cxx.julia",
338
+ "contentName": "source.cpp",
339
+ "patterns": [
340
+ {
341
+ "include": "source.cpp"
342
+ },
343
+ {
344
+ "include": "#string_dollar_sign_interpolate"
345
+ }
346
+ ]
347
+ },
348
+ {
349
+ "begin": "((i?cxxt?)|([rpv]cpp))(\")",
350
+ "beginCaptures": {
351
+ "1": {
352
+ "name": "support.function.macro.julia"
353
+ },
354
+ "4": {
355
+ "name": "punctuation.definition.string.begin.julia"
356
+ }
357
+ },
358
+ "end": "\"",
359
+ "name": "embed.cxx.julia",
360
+ "endCaptures": {
361
+ "0": {
362
+ "name": "punctuation.definition.string.end.julia"
363
+ }
364
+ },
365
+ "contentName": "source.cpp",
366
+ "patterns": [
367
+ {
368
+ "include": "source.cpp"
369
+ },
370
+ {
371
+ "include": "#string_dollar_sign_interpolate"
372
+ }
373
+ ]
374
+ },
375
+ {
376
+ "begin": "^\\s?([[:alpha:]_][[:word:]⁺-ₜ!′]*)?(\"\"\")\\s?$",
377
+ "beginCaptures": {
378
+ "1": {
379
+ "name": "support.function.macro.julia"
380
+ },
381
+ "2": {
382
+ "name": "punctuation.definition.string.begin.julia"
383
+ }
384
+ },
385
+ "end": "\\s?^\\s*(\"\"\")\\s?",
386
+ "endCaptures": {
387
+ "1": {
388
+ "name": "punctuation.definition.string.end.julia"
389
+ }
390
+ },
391
+ "name": "string.docstring.julia",
392
+ "contentName": "source.gfm",
393
+ "comment": "This only matches docstrings that start and end with triple quotes on\ntheir own line in the void",
394
+ "patterns": [
395
+ {
396
+ "include": "source.gfm"
397
+ },
398
+ {
399
+ "include": "#string_escaped_char"
400
+ },
401
+ {
402
+ "include": "#string_dollar_sign_interpolate"
403
+ }
404
+ ]
405
+ },
276
406
  {
277
407
  "begin": "'",
278
408
  "beginCaptures": {
@@ -294,6 +424,31 @@
294
424
  ]
295
425
  },
296
426
  {
427
+ "begin": "\"\"\"",
428
+ "beginCaptures": {
429
+ "0": {
430
+ "name": "punctuation.definition.string.multiline.begin.julia"
431
+ }
432
+ },
433
+ "end": "\"\"\"",
434
+ "endCaptures": {
435
+ "0": {
436
+ "name": "punctuation.definition.string.multiline.end.julia"
437
+ }
438
+ },
439
+ "name": "string.quoted.triple.double.julia",
440
+ "comment": "TODO: decide on a name for this scope",
441
+ "patterns": [
442
+ {
443
+ "include": "#string_escaped_char"
444
+ },
445
+ {
446
+ "include": "#string_dollar_sign_interpolate"
447
+ }
448
+ ]
449
+ },
450
+ {
451
+ "name": "string.quoted.double.julia",
297
452
  "begin": "\"",
298
453
  "beginCaptures": {
299
454
  "0": {
@@ -306,7 +461,34 @@
306
461
  "name": "punctuation.definition.string.end.julia"
307
462
  }
308
463
  },
309
- "name": "string.quoted.double.julia",
464
+ "comment": "String with single pair of double quotes. Regex matches isolated double quote",
465
+ "patterns": [
466
+ {
467
+ "include": "#string_escaped_char"
468
+ },
469
+ {
470
+ "include": "#string_dollar_sign_interpolate"
471
+ }
472
+ ]
473
+ },
474
+ {
475
+ "begin": "r\"",
476
+ "beginCaptures": {
477
+ "0": {
478
+ "name": "punctuation.definition.string.regexp.begin.julia"
479
+ }
480
+ },
481
+ "end": "(\")([imsx]{0,4})?",
482
+ "endCaptures": {
483
+ "1": {
484
+ "name": "punctuation.definition.string.regexp.end.julia"
485
+ },
486
+ "2": {
487
+ "comment": "I took this scope name from python regex grammar",
488
+ "name": "keyword.other.option-toggle.regexp.julia"
489
+ }
490
+ },
491
+ "name": "string.regexp.julia",
310
492
  "patterns": [
311
493
  {
312
494
  "include": "#string_escaped_char"
@@ -314,13 +496,13 @@
314
496
  ]
315
497
  },
316
498
  {
317
- "begin": "\\b\\w+\"",
499
+ "begin": "\\b[[:alpha:]_][[:word:]⁺-ₜ!′]*\"",
318
500
  "beginCaptures": {
319
501
  "0": {
320
502
  "name": "punctuation.definition.string.begin.julia"
321
503
  }
322
504
  },
323
- "end": "\"\\w*",
505
+ "end": "\"([[:alpha:]_][[:word:]⁺-ₜ!′]*)?",
324
506
  "endCaptures": {
325
507
  "0": {
326
508
  "name": "punctuation.definition.string.end.julia"
@@ -329,7 +511,7 @@
329
511
  "name": "string.quoted.other.julia",
330
512
  "patterns": [
331
513
  {
332
- "include": "#string_custom_escaped_char"
514
+ "include": "#string_escaped_char"
333
515
  }
334
516
  ]
335
517
  },
@@ -346,36 +528,103 @@
346
528
  "name": "punctuation.definition.string.end.julia"
347
529
  }
348
530
  },
349
- "name": "string.interpolated.julia",
531
+ "name": "string.interpolated.backtick.julia",
532
+ "patterns": [
533
+ {
534
+ "include": "#string_escaped_char"
535
+ },
536
+ {
537
+ "include": "#string_dollar_sign_interpolate"
538
+ }
539
+ ]
540
+ },
541
+ {
542
+ "begin": "(@doc) ((?:doc)?\"\"\")",
543
+ "beginCaptures": {
544
+ "1": {
545
+ "name": "support.function.macro.julia"
546
+ },
547
+ "2": {
548
+ "name": "punctuation.definition.string.begin.julia"
549
+ }
550
+ },
551
+ "end": "(\"\"\") ?(->)?",
552
+ "endCaptures": {
553
+ "1": {
554
+ "name": "punctuation.definition.string.end.julia"
555
+ },
556
+ "2": {
557
+ "name": "keyword.operator.arrow.julia"
558
+ }
559
+ },
560
+ "name": "string.docstring.julia",
561
+ "contentName": "source.gfm",
350
562
  "patterns": [
351
563
  {
352
564
  "include": "#string_escaped_char"
565
+ },
566
+ {
567
+ "include": "source.gfm"
568
+ },
569
+ {
570
+ "include": "#string_dollar_sign_interpolate"
353
571
  }
354
572
  ]
355
573
  }
356
574
  ]
357
575
  },
358
- "string_custom_escaped_char": {
576
+ "string_escaped_char": {
359
577
  "patterns": [
360
578
  {
361
- "match": "\\\\\"",
579
+ "match": "\\\\(\\\\|[0-3]\\d{,2}|[4-7]\\d?|x[a-fA-F0-9]{,2}|u[a-fA-F0-9]{,4}|U[a-fA-F0-9]{,8}|.)",
362
580
  "name": "constant.character.escape.julia"
363
581
  }
364
582
  ]
365
583
  },
366
- "string_escaped_char": {
584
+ "string_dollar_sign_interpolate": {
367
585
  "patterns": [
368
586
  {
369
- "match": "\\\\(\\\\|[0-3]\\d{0,2}|[4-7]\\d?|x[a-fA-F0-9]{0,2}|u[a-fA-F0-9]{0,4}|U[a-fA-F0-9]{0,8}|.)",
370
- "name": "constant.character.escape.julia"
587
+ "match": "\\$[[:alpha:]_][[:word:]⁺-ₜ!′]*",
588
+ "name": "variable.interpolation.julia"
589
+ },
590
+ {
591
+ "begin": "\\$\\(",
592
+ "end": "\\)",
593
+ "name": "variable.interpolation.julia",
594
+ "comment": "`punctuation.section.embedded`, `constant.escape`,\n& `meta.embedded.line` were considered but appear to have even spottier\nsupport among popular syntaxes.",
595
+ "patterns": [
596
+ {
597
+ "include": "#nest_parens_and_self"
598
+ },
599
+ {
600
+ "include": "$self"
601
+ }
602
+ ]
603
+ }
604
+ ]
605
+ },
606
+ "nest_parens_and_self": {
607
+ "patterns": [
608
+ {
609
+ "begin": "\\(",
610
+ "end": "\\)",
611
+ "patterns": [
612
+ {
613
+ "include": "#nest_parens_and_self"
614
+ }
615
+ ]
616
+ },
617
+ {
618
+ "include": "$self"
371
619
  }
372
620
  ]
373
621
  },
374
622
  "symbol": {
375
623
  "patterns": [
376
624
  {
377
- "match": "(?<![a-zA-Z0-9:<]:):[a-zA-Z_][a-zA-Z0-9_]*\\b",
378
- "name": "constant.other.symbol.julia"
625
+ "match": "(?<![a-zA-Z0-9:<]:)(?<=:)[[:alpha:]_][[:word:]⁺-ₜ!′]*",
626
+ "name": "constant.other.symbol.julia",
627
+ "comment": "This is string.quoted.symbol.julia in tpoisot's package"
379
628
  }
380
629
  ]
381
630
  },
@@ -384,24 +633,20 @@
384
633
  {
385
634
  "captures": {
386
635
  "1": {
387
- "name": "keyword.control.type.julia"
388
- },
389
- "2": {
390
636
  "name": "entity.name.type.julia"
391
637
  },
392
- "3": {
638
+ "2": {
393
639
  "name": "entity.other.inherited-class.julia"
394
640
  },
395
- "4": {
641
+ "3": {
396
642
  "name": "punctuation.separator.inheritance.julia"
397
643
  }
398
644
  },
399
- "match": "(((primitive|abstract)\\s+)?type|(mutable\\s+)?struct|immutable)\\s+(\\w+)(\\s*(<:)\\s*\\w+(?:{.*})?)?",
645
+ "match": "(?>!:_)(?:type|immutable|struct)\\s+([[:alpha:]_][[:word:]⁺-ₜ!′]*)(\\s*(<:)\\s*[[:alpha:]_][[:word:]⁺-ₜ!′]*(?:{.*})?)?",
400
646
  "name": "meta.type.julia"
401
647
  }
402
648
  ]
403
649
  }
404
650
  },
405
- "scopeName": "source.julia",
406
- "uuid": "F5D95417-DF9F-48AD-92DF-21CE62F7C31B"
651
+ "scopeName": "source.julia"
407
652
  }