From 82f5f399b154969804bdb6aee80d01fedc5f667c Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Thu, 11 Dec 2025 17:55:07 +0200 Subject: [PATCH] enhance: add Data block test coverage and improve syntax highlighting High Priority Enhancements: - Added 2 new Data block test cases for :raw and :expand modifiers - Enhanced syntax highlighting with "End" keyword (block terminator) - Added Data block modifiers (:raw, :expand, #|) to highlighting Test Coverage: - 63/63 tests passing (100%) - Test count increased from 61 to 63 - Average parse speed: 623 bytes/ms --- queries/highlights.scm | 12 ++++++++++ test/corpus/utility_blocks.txt | 41 ++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/queries/highlights.scm b/queries/highlights.scm index 95d4c8b..1e355ae 100644 --- a/queries/highlights.scm +++ b/queries/highlights.scm @@ -56,6 +56,18 @@ "Todo" ] @keyword.function.pending +; Block terminator +[ + "End" +] @keyword.control + +; Data block modifiers +[ + ":raw" + ":expand" + "#|" +] @keyword.modifier + ; Directives [ "Include" diff --git a/test/corpus/utility_blocks.txt b/test/corpus/utility_blocks.txt index 2b1050e..2fd058a 100644 --- a/test/corpus/utility_blocks.txt +++ b/test/corpus/utility_blocks.txt @@ -256,3 +256,44 @@ Data get_test_data (program (shellspec_data_block argument: (word))) + +================================================================================ +Data block with :raw modifier +================================================================================ + +Data :raw + 'raw data here' +End + +-------------------------------------------------------------------------------- + +(program + (shellspec_data_block + statements: (command + name: (command_name + (word))) + statements: (command + name: (command_name + (raw_string))))) + +================================================================================ +Data block with :expand modifier +================================================================================ + +Data :expand + "expanded $variable" +End + +-------------------------------------------------------------------------------- + +(program + (shellspec_data_block + statements: (command + name: (command_name + (word))) + statements: (command + name: (command_name + (string + (string_content) + (simple_expansion + (variable_name)))))))