diff --git a/CHANGES.md b/CHANGES.md index d27774f08f..87eba192ed 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,7 +2,6 @@ New Grammars: -- Added 3rd party LookML grammar to SUPPORTED_LANGUAGES [Josh Temple][] - added 3rd party LookML grammar to SUPPORTED_LANGUAGES [Josh Temple][] - added 3rd party FunC grammar to SUPPORTED_LANGUAGES [Nikita Sobolev][] @@ -14,12 +13,14 @@ Grammars: - fix(js) do not flag `import()` as a function, rather a keyword [nathnolt][] - fix(bash) recognize the `((` keyword [Nick Chambers][] - fix(nix) support escaped dollar signs in strings [h7x4][] +- enh(cmake) support bracket comments [Hirse][] [Josh Goebel]: https://github.com/joshgoebel [Josh Temple]: https://github.com/joshtemple [nathnolt]: https://github.com/nathnolt [Nick Chambers]: https://github.com/uplime [h7x4]: https://github.com/h7x4 +[Hirse]: https://github.com/Hirse ## Version 11.6.0 diff --git a/src/languages/cmake.js b/src/languages/cmake.js index dddbfc0dde..e5ba49b8cc 100644 --- a/src/languages/cmake.js +++ b/src/languages/cmake.js @@ -52,6 +52,7 @@ export default function(hljs) { begin: /\$\{/, end: /\}/ }, + hljs.COMMENT(/#\[\[/, /]]/), hljs.HASH_COMMENT_MODE, hljs.QUOTE_STRING_MODE, hljs.NUMBER_MODE diff --git a/test/markup/cmake/default.expect.txt b/test/markup/cmake/default.expect.txt index 638923c572..fd6c45401d 100644 --- a/test/markup/cmake/default.expect.txt +++ b/test/markup/cmake/default.expect.txt @@ -17,3 +17,7 @@ add_executable(myproject main.cpp mainwindow.cpp) qt5_use_modules(myproject Widgets) + +#[[This is a bracket comment. +It runs until the close bracket.]] +message("First Argument\n" #[[Bracket Comment]] "Second Argument") diff --git a/test/markup/cmake/default.txt b/test/markup/cmake/default.txt index 2bbea38c9d..1f4d7faa69 100644 --- a/test/markup/cmake/default.txt +++ b/test/markup/cmake/default.txt @@ -17,3 +17,7 @@ find_package(Qt5Widgets REQUIRED) add_executable(myproject main.cpp mainwindow.cpp) qt5_use_modules(myproject Widgets) + +#[[This is a bracket comment. +It runs until the close bracket.]] +message("First Argument\n" #[[Bracket Comment]] "Second Argument")