Skip to content

Commit da9da2a

Browse files
authored
Fix pragma literal (#145)
* Bumps 1.6.0 * Fixes #144 Wrong syntax highlighting of pragma
1 parent 17abfee commit da9da2a

File tree

1 file changed

+42
-4
lines changed

1 file changed

+42
-4
lines changed

syntaxes/nim.json

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,28 +296,48 @@
296296
},
297297
"patterns": [
298298
{
299-
"begin": "\\b([[:alpha:]]\\w*)(?:\\s|\\s*:)",
299+
"begin": "\\b([[:alpha:]]\\w*)\\(",
300300
"beginCaptures": {
301301
"1": {
302302
"name": "meta.preprocessor.pragma.nim"
303303
}
304304
},
305-
"end": "(?=\\.?\\}|,)",
305+
"end": "\\)",
306306
"patterns": [
307+
{
308+
"include": "#string_literal"
309+
},
307310
{
308311
"include": "source.nim"
309312
}
310313
]
311314
},
312315
{
313-
"begin": "\\b([[:alpha:]]\\w*)\\(",
316+
"begin": "\\b([[:alpha:]]\\w*)(?:\\s|\\s*:)",
314317
"beginCaptures": {
315318
"1": {
316319
"name": "meta.preprocessor.pragma.nim"
317320
}
318321
},
319-
"end": "\\)",
322+
"end": "(?=\\.?\\}|,)",
320323
"patterns": [
324+
{
325+
"begin": "\\b([[:alpha:]]\\w*)\\s*\\(",
326+
"beginCaptures": {
327+
"1": {
328+
"name": "support.function.any-method.nim"
329+
}
330+
},
331+
"end": "\\)",
332+
"patterns": [
333+
{
334+
"include": "#string_literal"
335+
},
336+
{
337+
"include": "source.nim"
338+
}
339+
]
340+
},
321341
{
322342
"include": "source.nim"
323343
}
@@ -1046,6 +1066,24 @@
10461066
]
10471067
}
10481068
]
1069+
},
1070+
{
1071+
"begin": "\\b(\\w+)\\s*\\(",
1072+
"beginCaptures": {
1073+
"1": {
1074+
"name": "support.function.any-method.nim"
1075+
}
1076+
},
1077+
"patterns": [
1078+
{
1079+
"include": "#string_literal"
1080+
},
1081+
{
1082+
"include": "source.nim"
1083+
}
1084+
],
1085+
"end": "\\)",
1086+
"name": "meta.function-call.nim"
10491087
}
10501088
],
10511089
"repository": {

0 commit comments

Comments
 (0)