mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 16:15:41 +01:00
Tokenizer single-quote docstrings as documentation comments
This commit is contained in:
parent
6d9c7ea306
commit
b70454a6b9
1 changed files with 24 additions and 0 deletions
|
|
@ -532,6 +532,13 @@ export const language = <languages.IMonarchLanguage>{
|
||||||
next: '@doubleQuotedHeredocDocstring'
|
next: '@doubleQuotedHeredocDocstring'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
/\@(module|type)?doc (~[sS])?'''/,
|
||||||
|
{
|
||||||
|
token: 'comment.block.documentation',
|
||||||
|
next: '@singleQuotedHeredocDocstring'
|
||||||
|
}
|
||||||
|
],
|
||||||
[
|
[
|
||||||
/\@(module|type)?doc (~[sS])?"/,
|
/\@(module|type)?doc (~[sS])?"/,
|
||||||
{
|
{
|
||||||
|
|
@ -539,6 +546,13 @@ export const language = <languages.IMonarchLanguage>{
|
||||||
next: '@doubleQuotedStringDocstring'
|
next: '@doubleQuotedStringDocstring'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
/\@(module|type)?doc (~[sS])?'/,
|
||||||
|
{
|
||||||
|
token: 'comment.block.documentation',
|
||||||
|
next: '@singleQuotedStringDocstring'
|
||||||
|
}
|
||||||
|
],
|
||||||
[/\@(module|type)?doc false/, 'comment.block.documentation'],
|
[/\@(module|type)?doc false/, 'comment.block.documentation'],
|
||||||
// Module attributes
|
// Module attributes
|
||||||
[/\@(@variableName)/, 'variable']
|
[/\@(@variableName)/, 'variable']
|
||||||
|
|
@ -549,11 +563,21 @@ export const language = <languages.IMonarchLanguage>{
|
||||||
{ include: '@docstringContent' }
|
{ include: '@docstringContent' }
|
||||||
],
|
],
|
||||||
|
|
||||||
|
singleQuotedHeredocDocstring: [
|
||||||
|
[/'''/, { token: 'comment.block.documentation', next: '@pop' }],
|
||||||
|
{ include: '@docstringContent' }
|
||||||
|
],
|
||||||
|
|
||||||
doubleQuotedStringDocstring: [
|
doubleQuotedStringDocstring: [
|
||||||
[/"/, { token: 'comment.block.documentation', next: '@pop' }],
|
[/"/, { token: 'comment.block.documentation', next: '@pop' }],
|
||||||
{ include: '@docstringContent' }
|
{ include: '@docstringContent' }
|
||||||
],
|
],
|
||||||
|
|
||||||
|
singleQuotedStringDocstring: [
|
||||||
|
[/'/, { token: 'comment.block.documentation', next: '@pop' }],
|
||||||
|
{ include: '@docstringContent' }
|
||||||
|
],
|
||||||
|
|
||||||
// Operators, punctuation, brackets
|
// Operators, punctuation, brackets
|
||||||
|
|
||||||
symbols: [
|
symbols: [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue