From 4e485f222e8c604b92937870414cf401e9dff31f Mon Sep 17 00:00:00 2001 From: Somya Bansal <77123777+somya-05@users.noreply.github.com> Date: Wed, 23 Oct 2024 04:02:45 +0530 Subject: [PATCH] fix(basic) - closing quotation marks not required for a `PRINT` statement (#4137) --- CHANGES.md | 2 ++ src/languages/basic.js | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index d0d823a2c7..8fe38020cb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -23,6 +23,7 @@ Core Grammars: - fix(sql) - Fixed sql primary key and foreign key spacing issue [Dxuian] - fix(cpp) added flat_set and flat_map as a part of cpp 23 version [Lavan] - fix(yaml) - Fixed special chars in yaml [Dxuian] +- fix(basic) - Fixed closing quotation marks not required for a PRINT statement [Somya] New Grammars: @@ -56,6 +57,7 @@ CONTRIBUTORS [Osmocom]: https://github.com/osmocom [Álvaro Mondéjar]: https://github.com/mondeja [Lavan]: https://github.com/jvlavan +[Somya]: https://github.com/somya-05 ## Version 11.10.0 diff --git a/src/languages/basic.js b/src/languages/basic.js index d359d541c2..054f306434 100644 --- a/src/languages/basic.js +++ b/src/languages/basic.js @@ -198,7 +198,13 @@ export default function(hljs) { keyword: KEYWORDS }, contains: [ - hljs.QUOTE_STRING_MODE, + { + // Match strings that start with " and end with " or a line break + scope: 'string', + begin: /"/, + end: /"|$/, + contains: [ hljs.BACKSLASH_ESCAPE ] + }, hljs.COMMENT('REM', '$', { relevance: 10 }), hljs.COMMENT('\'', '$', { relevance: 0 }), {