From a7e038523acc42650b2c85b6027c1fe0c6b8f493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20K=C5=82osko?= Date: Thu, 8 Dec 2022 12:11:39 +0100 Subject: [PATCH] Tokenizer single-quote docstrings as documentation comments --- src/basic-languages/elixir/elixir.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/basic-languages/elixir/elixir.ts b/src/basic-languages/elixir/elixir.ts index 210ac6bca0..078d103070 100644 --- a/src/basic-languages/elixir/elixir.ts +++ b/src/basic-languages/elixir/elixir.ts @@ -532,6 +532,13 @@ export const language = { next: '@doubleQuotedHeredocDocstring' } ], + [ + /\@(module|type)?doc (~[sS])?'''/, + { + token: 'comment.block.documentation', + next: '@singleQuotedHeredocDocstring' + } + ], [ /\@(module|type)?doc (~[sS])?"/, { @@ -539,6 +546,13 @@ export const language = { next: '@doubleQuotedStringDocstring' } ], + [ + /\@(module|type)?doc (~[sS])?'/, + { + token: 'comment.block.documentation', + next: '@singleQuotedStringDocstring' + } + ], [/\@(module|type)?doc false/, 'comment.block.documentation'], // Module attributes [/\@(@variableName)/, 'variable'] @@ -549,11 +563,21 @@ export const language = { { 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: [