Skip to content

Commit cee1892

Browse files
committed
放弃了,这个语法文件太难搞
1 parent cb81126 commit cee1892

File tree

1 file changed

+43
-7
lines changed

1 file changed

+43
-7
lines changed

syntaxes/lua.tmLanguage.json

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
"name": "punctuation.definition.string.begin.lua"
202202
}
203203
},
204-
"end": "'",
204+
"end": "'[ \\t]*",
205205
"endCaptures": {
206206
"0": {
207207
"name": "punctuation.definition.string.end.lua"
@@ -221,7 +221,7 @@
221221
"name": "punctuation.definition.string.begin.lua"
222222
}
223223
},
224-
"end": "\"",
224+
"end": "\"[ \\t]*",
225225
"endCaptures": {
226226
"0": {
227227
"name": "punctuation.definition.string.end.lua"
@@ -245,7 +245,7 @@
245245
}
246246
},
247247
"contentName": "meta.embedded.lua",
248-
"end": "(\\]\\2\\])",
248+
"end": "(\\]\\2\\])[ \\t]*",
249249
"endCaptures": {
250250
"0": {
251251
"name": "string.quoted.other.multiline.lua"
@@ -267,7 +267,7 @@
267267
"name": "punctuation.definition.string.begin.lua"
268268
}
269269
},
270-
"end": "\\]\\1\\]",
270+
"end": "\\]\\1\\][ \\t]*",
271271
"endCaptures": {
272272
"0": {
273273
"name": "punctuation.definition.string.end.lua"
@@ -410,7 +410,7 @@
410410
"begin": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b",
411411
"beginCaptures": {
412412
"0": {
413-
"name": "variable.lua"
413+
"name": "entity.name.variable.lua"
414414
}
415415
},
416416
"end": "(?=\\n)",
@@ -421,21 +421,57 @@
421421
]
422422
}
423423
]
424+
},
425+
{
426+
"begin": "@return",
427+
"beginCaptures": {
428+
"0": {
429+
"name": "storage.type.annotation.lua"
430+
}
431+
},
432+
"end": "(?=\\n)",
433+
"patterns": [
434+
{
435+
"include": "#luadoc.type"
436+
}
437+
]
424438
}
425439
]
426440
},
427441
"luadoc.type": {
442+
"begin": "(?=[a-zA-Z_\\.\"])",
443+
"end": "(?=\\s)",
428444
"patterns": [
429445
{
430-
"match": "\\b([a-zA-Z_][a-zA-Z0-9_\\.]*)\\b",
446+
"match": "(\\b([a-zA-Z_][a-zA-Z0-9_\\.]*)\\b)[ \\t]*",
431447
"name": "support.type.lua"
432448
},
433449
{
434-
"match": "\\|",
450+
"include": "#string"
451+
},
452+
{
453+
"include": "#luadoc.type.resume"
454+
}
455+
]
456+
},
457+
"luadoc.type.resume": {
458+
"begin": "\\|",
459+
"beginCaptures": {
460+
"0": {
435461
"name": "keyword.operator.lua"
462+
}
463+
},
464+
"end": "(?=\\s)",
465+
"patterns": [
466+
{
467+
"match": "(\\b([a-zA-Z_][a-zA-Z0-9_\\.]*)\\b)[ \\t]*",
468+
"name": "support.type.lua"
436469
},
437470
{
438471
"include": "#string"
472+
},
473+
{
474+
"include": "#luadoc.type.resume"
439475
}
440476
]
441477
}

0 commit comments

Comments
 (0)