Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enh(cmake) support bracket comments #3644

Merged
merged 1 commit into from
Oct 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")