Skip to content

Commit

Permalink
enh(cmake) support bracket comments (#3644)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hirse committed Oct 23, 2022
1 parent 71f5cb2 commit abcb53d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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][]

Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/languages/cmake.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export default function(hljs) {
begin: /\$\{/,
end: /\}/
},
hljs.COMMENT(/#\[\[/, /]]/),
hljs.HASH_COMMENT_MODE,
hljs.QUOTE_STRING_MODE,
hljs.NUMBER_MODE
Expand Down
4 changes: 4 additions & 0 deletions test/markup/cmake/default.expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@

<span class="hljs-keyword">add_executable</span>(myproject main.cpp mainwindow.cpp)
<span class="hljs-keyword">qt5_use_modules</span>(myproject Widgets)

<span class="hljs-comment">#[[This is a bracket comment.
It runs until the close bracket.]]</span>
<span class="hljs-keyword">message</span>(<span class="hljs-string">&quot;First Argument\n&quot;</span> <span class="hljs-comment">#[[Bracket Comment]]</span> <span class="hljs-string">&quot;Second Argument&quot;</span>)
4 changes: 4 additions & 0 deletions test/markup/cmake/default.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")

0 comments on commit abcb53d

Please sign in to comment.