From de76be4e6c88374b1e6420b8bc6a179af8d2ef02 Mon Sep 17 00:00:00 2001 From: claylibrarymarket <47158415+claylibrarymarket@users.noreply.github.com> Date: Fri, 7 Jul 2023 09:58:33 -0500 Subject: [PATCH 1/2] Update twig.ts --- src/basic-languages/twig/twig.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/basic-languages/twig/twig.ts b/src/basic-languages/twig/twig.ts index 30a05eb7..2dc7c42c 100644 --- a/src/basic-languages/twig/twig.ts +++ b/src/basic-languages/twig/twig.ts @@ -104,7 +104,7 @@ export const language = { [/(<)((?:[\w\-]+:)?[\w\-]+)/, ['delimiter.html', { token: 'tag.html', next: '@otherTag' }]], [/(<\/)((?:[\w\-]+:)?[\w\-]+)/, ['delimiter.html', { token: 'tag.html', next: '@otherTag' }]], [/ Date: Fri, 7 Jul 2023 10:07:41 -0500 Subject: [PATCH 2/2] Update twig.test.ts --- src/basic-languages/twig/twig.test.ts | 33 +++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/basic-languages/twig/twig.test.ts b/src/basic-languages/twig/twig.test.ts index a957eec7..179323b1 100644 --- a/src/basic-languages/twig/twig.test.ts +++ b/src/basic-languages/twig/twig.test.ts @@ -734,6 +734,15 @@ testTokenization( tokens: [{ startIndex: 0, type: 'comment.twig' }] } ], + [ + { + line: 'test {# Hello World! #}', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 5, type: 'comment.twig' } + ] + } + ], [ { line: '{#Hello World!#}', @@ -860,6 +869,19 @@ testTokenization( ] } ], + [ + { + line: 'test {{ foo }}', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 5, type: 'delimiter.twig' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'variable.twig' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'delimiter.twig' } + ] + } + ], [ { line: '{{ foo(42) }}', @@ -962,6 +984,17 @@ testTokenization( ] } ], + [ + { + line: 'test {% %}', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 5, type: 'delimiter.twig' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'delimiter.twig' } + ] + } + ], [ { line: '{% for item in navigation %}',