Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
338 changes: 337 additions & 1 deletion grammars/renpy.cson
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,9 @@
{
'include': '#string_quoted_double'
}
{
'include': '#string_quoted_backtick'
}
{
'include': '#dotted_name'
}
Expand Down Expand Up @@ -765,6 +768,16 @@
}
]
}
{
'begin': '^\\s*(?=[uU]?[rR]?```)'
'end': '(?<=```)'
'name': 'comment.block.python.renpy'
'patterns': [
{
'include': '#string_quoted_backtick'
}
]
}
]
'dotted_name':
'begin': '(?=[A-Za-z_][A-Za-z0-9_]*(?:\\.[A-Za-z_][A-Za-z0-9_]*)*)'
Expand Down Expand Up @@ -1583,6 +1596,326 @@
]
}
]
'string_quoted_backtick':
'patterns': [
{
'captures':
'1':
'name': 'punctuation.definition.string.begin.python.renpy'
'2':
'name': 'punctuation.definition.string.end.python.renpy'
'3':
'name': 'meta.empty-string.single.python.renpy'
'match': '(?<!`)(`)((`))(?!`)'
'name': 'string.quoted.single.single-line.python.renpy'
}
{
'begin': '([uU]r)(```)'
'beginCaptures':
'1':
'name': 'storage.type.string.python.renpy'
'2':
'name': 'punctuation.definition.string.begin.python.renpy'
'comment': 'single quoted unicode-raw string'
'end': '((?<=```)(`)``|```)'
'endCaptures':
'1':
'name': 'punctuation.definition.string.end.python.renpy'
'2':
'name': 'meta.empty-string.single.python.renpy'
'name': 'string.quoted.single.block.unicode-raw-regex.python.renpy'
'patterns': [
{ 'include': '#escaped_placeholder' }
{
'include': '#constant_placeholder'
}
{
'include': '#escaped_unicode_char'
}
{
'include': '#escaped_char'
}
{
'include': '#regular_expressions'
}
]
}
{
'begin': '([uU]R)(```)'
'beginCaptures':
'1':
'name': 'storage.type.string.python.renpy'
'2':
'name': 'punctuation.definition.string.begin.python.renpy'
'comment': 'single quoted unicode-raw string'
'end': '((?<=```)(`)``|```)'
'endCaptures':
'1':
'name': 'punctuation.definition.string.end.python.renpy'
'2':
'name': 'meta.empty-string.single.python.renpy'
'name': 'string.quoted.single.block.unicode-raw.python.renpy'
'patterns': [
{ 'include': '#escaped_placeholder' }
{
'include': '#constant_placeholder'
}
{
'include': '#escaped_unicode_char'
}
{
'include': '#escaped_char'
}
]
}
{
'begin': '(r)(```)'
'beginCaptures':
'1':
'name': 'storage.type.string.python.renpy'
'2':
'name': 'punctuation.definition.string.begin.python.renpy'
'comment': 'single quoted raw string'
'end': '((?<=```)(`)``|```)'
'endCaptures':
'1':
'name': 'punctuation.definition.string.end.python.renpy'
'2':
'name': 'meta.empty-string.single.python.renpy'
'name': 'string.quoted.single.block.raw-regex.python.renpy'
'patterns': [
{ 'include': '#escaped_placeholder' }
{
'include': '#constant_placeholder'
}
{
'include': '#escaped_char'
}
{
'include': '#regular_expressions'
}
]
}
{
'begin': '(R)(```)'
'beginCaptures':
'1':
'name': 'storage.type.string.python.renpy'
'2':
'name': 'punctuation.definition.string.begin.python.renpy'
'comment': 'single quoted raw string'
'end': '((?<=```)(`)``|```)'
'endCaptures':
'1':
'name': 'punctuation.definition.string.end.python.renpy'
'2':
'name': 'meta.empty-string.single.python.renpy'
'name': 'string.quoted.single.block.raw.python.renpy'
'patterns': [
{ 'include': '#escaped_placeholder' }
{
'include': '#constant_placeholder'
}
{
'include': '#escaped_char'
}
]
}
{
'begin': '([uU])(```)'
'beginCaptures':
'1':
'name': 'storage.type.string.python.renpy'
'2':
'name': 'punctuation.definition.string.begin.python.renpy'
'comment': 'single quoted unicode string'
'end': '((?<=```)(`)``|```)'
'endCaptures':
'1':
'name': 'punctuation.definition.string.end.python.renpy'
'2':
'name': 'meta.empty-string.single.python.renpy'
'name': 'string.quoted.single.block.unicode.python.renpy'
'patterns': [
{ 'include': '#escaped_placeholder' }
{
'include': '#constant_placeholder'
}
{
'include': '#escaped_unicode_char'
}
{
'include': '#escaped_char'
}
]
}
{
'captures':
'1':
'name': 'storage.type.string.python.renpy'
'2':
'name': 'punctuation.definition.string.begin.python.renpy'
'3':
'patterns': [
{ 'include': '#escaped_placeholder' }
{'include': '#constant_placeholder'}
{'include': '#escaped_unicode_char'}
{'include': '#escaped_char'}
{'include': '#regular_expressions'}
]
'4':
'name': 'punctuation.definition.string.end.python.renpy'
'comment': 'single quoted raw string'
'match': '([uU]r)(`)((?:[^`\\\\]|\\\\.)*)(`)'
'name': 'string.quoted.single.single-line.unicode-raw-regex.python.renpy'
}
{
'begin': '([uU]R)(`)'
'beginCaptures':
'1':
'name': 'storage.type.string.python.renpy'
'2':
'name': 'punctuation.definition.string.begin.python.renpy'
'comment': 'single quoted raw string'
'end': '(`)'
'endCaptures':
'1':
'name': 'punctuation.definition.string.end.python.renpy'
'2':
'name': 'invalid.illegal.unclosed-string.python.renpy'
'name': 'string.quoted.single.single-line.unicode-raw.python.renpy'
'patterns': [
{ 'include': '#escaped_placeholder' }
{
'include': '#constant_placeholder'
}
{
'include': '#escaped_unicode_char'
}
{
'include': '#escaped_char'
}
]
}
{
'captures':
'1':
'name': 'storage.type.string.python.renpy'
'2':
'name': 'punctuation.definition.string.begin.python.renpy'
'3':
'patterns': [
{ 'include': '#escaped_placeholder' }
{'include': '#constant_placeholder'}
{'include': '#escaped_char'}
{'include': '#regular_expressions'}
]
'4':
'name': 'punctuation.definition.string.end.python.renpy'
'comment': 'single quoted raw string'
'match': '(r)(`)((?:[^`\\\\]|\\\\.)*)(`)'
'name': 'string.quoted.single.single-line.raw-regex.python.renpy'
}
{
'begin': '(R)(`)'
'beginCaptures':
'1':
'name': 'storage.type.string.python.renpy'
'2':
'name': 'punctuation.definition.string.begin.python.renpy'
'comment': 'single quoted raw string'
'end': '(`)|(\\n)'
'endCaptures':
'1':
'name': 'punctuation.definition.string.end.python.renpy'
'2':
'name': 'invalid.illegal.unclosed-string.python.renpy'
'name': 'string.quoted.single.single-line.raw.python.renpy'
'patterns': [
{ 'include': '#escaped_placeholder' }
{
'include': '#constant_placeholder'
}
{
'include': '#escaped_char'
}
]
}
{
'begin': '([uU])(`)'
'beginCaptures':
'1':
'name': 'storage.type.string.python.renpy'
'2':
'name': 'punctuation.definition.string.begin.python.renpy'
'comment': 'single quoted unicode string'
'end': '(`)'
'endCaptures':
'1':
'name': 'punctuation.definition.string.end.python.renpy'
'2':
'name': 'invalid.illegal.unclosed-string.python.renpy'
'name': 'string.quoted.single.single-line.unicode.python.renpy'
'patterns': [
{ 'include': '#escaped_placeholder' }
{
'include': '#constant_placeholder'
}
{
'include': '#escaped_unicode_char'
}
{
'include': '#escaped_char'
}
]
}
{
'begin': '(```)'
'beginCaptures':
'1':
'name': 'punctuation.definition.string.begin.python.renpy'
'comment': 'single quoted string'
'end': '((?<=```)(`)``|```)'
'endCaptures':
'1':
'name': 'punctuation.definition.string.end.python.renpy'
'2':
'name': 'meta.empty-string.single.python.renpy'
'name': 'string.quoted.single.block.python.renpy'
'patterns': [
{ 'include': '#escaped_placeholder' }
{
'include': '#constant_placeholder'
}
{
'include': '#escaped_char'
}
]
}
{
'begin': '(`)'
'beginCaptures':
'1':
'name': 'punctuation.definition.string.begin.python.renpy'
'comment': 'single quoted string'
'end': '(`)'
'endCaptures':
'1':
'name': 'punctuation.definition.string.end.python.renpy'
'2':
'name': 'invalid.illegal.unclosed-string.python.renpy'
'name': 'string.quoted.single.single-line.python.renpy'
'patterns': [
{ 'include': '#escaped_placeholder' }
{
'include': '#constant_placeholder'
}
{
'include': '#escaped_char'
}
]
}
]
'strings':
'patterns': [
{
Expand All @@ -1591,4 +1924,7 @@
{
'include': '#string_quoted_single'
}
]
{
'include': '#string_quoted_backtick'
}
]
Loading