Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit bd688cc

Browse files
author
Alhadis
committed
Simplify tokenisation of quoted strings in JSDoc
1 parent eb04696 commit bd688cc

File tree

2 files changed

+55
-83
lines changed

2 files changed

+55
-83
lines changed

grammars/jsdoc.cson

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -433,45 +433,17 @@
433433
# Default @param value, highlighted as JavaScript
434434
'default-value':
435435
'patterns': [
436-
# Double-quoted string
436+
# Strings
437437
{
438-
'begin': '(")'
438+
'begin': '("|\')'
439439
'beginCaptures':
440440
'0':
441-
'name': 'string.quoted.double.js'
442-
'1':
443-
'name': 'punctuation.definition.string.begin.js'
444-
'contentName': 'string.quoted.double.js'
445-
'end': '(")|(?=\\*/)'
446-
'endCaptures':
447-
'0':
448-
'name': 'string.quoted.double.js'
449-
'1':
450-
'name': 'punctuation.definition.string.end.js'
451-
'name': 'source.embedded.js'
452-
'patterns': [
453-
{
454-
'match': '\\\\(?:[^*]|\\*(?!/))'
455-
'name': 'constant.character.escape.js'
456-
}
457-
]
458-
}
459-
# Single-quoted string
460-
{
461-
'begin': "(')"
462-
'beginCaptures':
463-
'0':
464-
'name': 'string.quoted.single.js'
465-
'1':
466441
'name': 'punctuation.definition.string.begin.js'
467-
'contentName': 'string.quoted.single.js'
468-
'end': "(')|(?=\\*/)"
442+
'end': '\\1|(?=\\*/)'
469443
'endCaptures':
470444
'0':
471-
'name': 'string.quoted.single.js'
472-
'1':
473445
'name': 'punctuation.definition.string.end.js'
474-
'name': 'source.embedded.js'
446+
'name': 'string.quoted.js'
475447
'patterns': [
476448
{
477449
'match': '\\\\(?:[^*]|\\*(?!/))'

0 commit comments

Comments
 (0)