Skip to content

Commit

Permalink
Tokenizer single-quote docstrings as documentation comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatanklosko committed Dec 8, 2022
1 parent 807d97d commit a7e0385
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/basic-languages/elixir/elixir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -532,13 +532,27 @@ export const language = <languages.IMonarchLanguage>{
next: '@doubleQuotedHeredocDocstring'
}
],
[
/\@(module|type)?doc (~[sS])?'''/,
{
token: 'comment.block.documentation',
next: '@singleQuotedHeredocDocstring'
}
],
[
/\@(module|type)?doc (~[sS])?"/,
{
token: 'comment.block.documentation',
next: '@doubleQuotedStringDocstring'
}
],
[
/\@(module|type)?doc (~[sS])?'/,
{
token: 'comment.block.documentation',
next: '@singleQuotedStringDocstring'
}
],
[/\@(module|type)?doc false/, 'comment.block.documentation'],
// Module attributes
[/\@(@variableName)/, 'variable']
Expand All @@ -549,11 +563,21 @@ export const language = <languages.IMonarchLanguage>{
{ include: '@docstringContent' }
],

singleQuotedHeredocDocstring: [
[/'''/, { token: 'comment.block.documentation', next: '@pop' }],
{ include: '@docstringContent' }
],

doubleQuotedStringDocstring: [
[/"/, { token: 'comment.block.documentation', next: '@pop' }],
{ include: '@docstringContent' }
],

singleQuotedStringDocstring: [
[/'/, { token: 'comment.block.documentation', next: '@pop' }],
{ include: '@docstringContent' }
],

// Operators, punctuation, brackets

symbols: [
Expand Down

0 comments on commit a7e0385

Please sign in to comment.