From 19a4a572dba0ee23f8c506bd82b300a866adb08f Mon Sep 17 00:00:00 2001
From: yxshee <84263676+yxshee@users.noreply.github.com>
Date: Thu, 19 Nov 2026 18:16:08 +0530
Subject: [PATCH] fix(lexers): keep CMake bracket arguments intact
---
lexers/embedded/cmake.xml | 3 +++
lexers/testdata/cmake.actual | 4 ++++
lexers/testdata/cmake.expected | 20 ++++++++++++++++++++
3 files changed, 27 insertions(+)
diff --git a/lexers/embedded/cmake.xml b/lexers/embedded/cmake.xml
index ad6157bbf..ffe00e63d 100644
--- a/lexers/embedded/cmake.xml
+++ b/lexers/embedded/cmake.xml
@@ -56,6 +56,9 @@
+
+
+
diff --git a/lexers/testdata/cmake.actual b/lexers/testdata/cmake.actual
index cbc7c2044..0df76a936 100644
--- a/lexers/testdata/cmake.actual
+++ b/lexers/testdata/cmake.actual
@@ -1 +1,5 @@
project(example)
+message([=[a ) # literal ]==] "quote"
+still one argument]=])
+message("next")
+message(${v}[[a b]])
diff --git a/lexers/testdata/cmake.expected b/lexers/testdata/cmake.expected
index 6a8c1bdd3..59da534ef 100644
--- a/lexers/testdata/cmake.expected
+++ b/lexers/testdata/cmake.expected
@@ -3,5 +3,25 @@
{"type":"Punctuation","value":"("},
{"type":"LiteralString","value":"example"},
{"type":"Punctuation","value":")"},
+ {"type":"Text","value":"\n"},
+ {"type":"NameBuiltin","value":"message"},
+ {"type":"Punctuation","value":"("},
+ {"type":"LiteralString","value":"[=[a ) # literal ]==] \"quote\"\nstill one argument]=]"},
+ {"type":"Punctuation","value":")"},
+ {"type":"Text","value":"\n"},
+ {"type":"NameBuiltin","value":"message"},
+ {"type":"Punctuation","value":"("},
+ {"type":"LiteralStringDouble","value":"\"next\""},
+ {"type":"Punctuation","value":")"},
+ {"type":"Text","value":"\n"},
+ {"type":"NameBuiltin","value":"message"},
+ {"type":"Punctuation","value":"("},
+ {"type":"Operator","value":"${"},
+ {"type":"NameVariable","value":"v"},
+ {"type":"Operator","value":"}"},
+ {"type":"LiteralString","value":"[[a"},
+ {"type":"Text","value":" "},
+ {"type":"LiteralString","value":"b]]"},
+ {"type":"Punctuation","value":")"},
{"type":"Text","value":"\n"}
]