Skip to content
This repository was archived by the owner on Jul 30, 2019. It is now read-only.

Commit 0f46703

Browse files
committed
fix bracket-comment-regex
fixes #27
1 parent ddb54ba commit 0f46703

File tree

4 files changed

+41
-41
lines changed

4 files changed

+41
-41
lines changed

cmake.vim.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ set cpo&vim
2222
syn region cmakeBracketArgument start="\[\z(=\?\|=[0-9]*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell
2323

2424
syn region cmakeComment start="#" end="$" contains=cmakeTodo,@Spell
25-
syn region cmakeBracketComment start="#\[\z(=\?\|=[0-9]*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell
25+
syn region cmakeBracketComment start="\[\z(=*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell
2626

2727
syn match cmakeEscaped /\(\\\\\|\\"\|\\n\|\\t\)/ contained
2828
syn region cmakeRegistry start="\[" end="]" contained oneline contains=cmakeTodo,cmakeEscaped

syntax/cmake.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ set cpo&vim
2222
syn region cmakeBracketArgument start="\[\z(=\?\|=[0-9]*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell
2323

2424
syn region cmakeComment start="#" end="$" contains=cmakeTodo,@Spell
25-
syn region cmakeBracketComment start="#\[\z(=\?\|=[0-9]*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell
25+
syn region cmakeBracketComment start="\[\z(=*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell
2626

2727
syn match cmakeEscaped /\(\\\\\|\\"\|\\n\|\\t\)/ contained
2828
syn region cmakeRegistry start="\[" end="]" contained oneline contains=cmakeTodo,cmakeEscaped

test/bracket-args-and-comment.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ The text does not end on a closing bracket of length 0 like ]].
1313
It does end in a closing bracket of length 1.
1414
]=])
1515

16-
message(FATAL_ERROR [=123[
16+
message(FATAL_ERROR [==[
1717
This is the first line in a bracket argument with bracket length 1.
1818
No \-escape sequences or ${variable} references are evaluated.
1919
This is always one argument even though it contains a ; character.
2020
The text does not end on a closing bracket of length 0 like ]].
2121
It does end in a closing bracket of length 1.
22-
]=123])
22+
]==])
2323

2424
[[ # this will make a cmake-error but defines a bracket-arguemnt
2525
cmake_minimum_required(VERSION 4.0 FATAL_ERROR) # Should be string-colored
@@ -43,7 +43,7 @@ It runs until the close bracket.]]
4343

4444
message("First Argument\n" #[[Bracket Comment]] "Second Argument")
4545

46-
#[=12[
46+
#[=[
4747
comment
48-
]=12]
48+
]=]
4949

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
11
<body>
22
<pre id='vimCodeElement'>
3-
<span class="Identifier">message</span>(<span class="ModeMsg">FATAL_ERROR</span> <span class="Constant">[[</span>
4-
<span class="Constant">This is the first line in a bracket argument with bracket length 1.</span>
5-
<span class="Constant">No \-escape sequences or ${variable} references are evaluated.</span>
6-
<span class="Constant">This is always one argument even though it contains a ; character.</span>
7-
<span class="Constant">It does end in a closing bracket of length 1.</span>
8-
<span class="Constant">]]</span>)
9-
10-
<span class="Identifier">message</span>(<span class="ModeMsg">FATAL_ERROR</span> <span class="Constant">[=[</span>
11-
<span class="Constant">This is the first line in a bracket argument with bracket length 1.</span>
12-
<span class="Constant">No \-escape sequences or ${variable} references are evaluated.</span>
13-
<span class="Constant">This is always one argument even though it contains a ; character.</span>
14-
<span class="Constant">The text does not end on a closing bracket of length 0 like ]].</span>
15-
<span class="Constant">It does end in a closing bracket of length 1.</span>
16-
<span class="Constant">]=]</span>)
17-
18-
<span class="Identifier">message</span>(<span class="ModeMsg">FATAL_ERROR</span> <span class="Constant">[=123[</span>
19-
<span class="Constant">This is the first line in a bracket argument with bracket length 1.</span>
20-
<span class="Constant">No \-escape sequences or ${variable} references are evaluated.</span>
21-
<span class="Constant">This is always one argument even though it contains a ; character.</span>
22-
<span class="Constant">The text does not end on a closing bracket of length 0 like ]].</span>
23-
<span class="Constant">It does end in a closing bracket of length 1.</span>
24-
<span class="Constant">]=123]</span>)
25-
26-
<span class="Constant">[[ # this will make a cmake-error but defines a bracket-arguemnt</span>
27-
<span class="Constant">cmake_minimum_required(VERSION 4.0 FATAL_ERROR) # Should be string-colored</span>
28-
<span class="Constant">]]</span>
3+
<span class="Identifier">message</span>(<span class="ModeMsg">FATAL_ERROR</span> <span class="Comment">[[</span>
4+
<span class="Comment">This is the first line in a bracket argument with bracket length 1.</span>
5+
<span class="Comment">No \-escape sequences or ${variable} references are evaluated.</span>
6+
<span class="Comment">This is always one argument even though it contains a ; character.</span>
7+
<span class="Comment">It does end in a closing bracket of length 1.</span>
8+
<span class="Comment">]]</span>)
9+
10+
<span class="Identifier">message</span>(<span class="ModeMsg">FATAL_ERROR</span> <span class="Comment">[=[</span>
11+
<span class="Comment">This is the first line in a bracket argument with bracket length 1.</span>
12+
<span class="Comment">No \-escape sequences or ${variable} references are evaluated.</span>
13+
<span class="Comment">This is always one argument even though it contains a ; character.</span>
14+
<span class="Comment">The text does not end on a closing bracket of length 0 like ]].</span>
15+
<span class="Comment">It does end in a closing bracket of length 1.</span>
16+
<span class="Comment">]=]</span>)
17+
18+
<span class="Identifier">message</span>(<span class="ModeMsg">FATAL_ERROR</span> <span class="Comment">[==[</span>
19+
<span class="Comment">This is the first line in a bracket argument with bracket length 1.</span>
20+
<span class="Comment">No \-escape sequences or ${variable} references are evaluated.</span>
21+
<span class="Comment">This is always one argument even though it contains a ; character.</span>
22+
<span class="Comment">The text does not end on a closing bracket of length 0 like ]].</span>
23+
<span class="Comment">It does end in a closing bracket of length 1.</span>
24+
<span class="Comment">]==]</span>)
25+
26+
<span class="Comment">[[ # this will make a cmake-error but defines a bracket-arguemnt</span>
27+
<span class="Comment">cmake_minimum_required(VERSION 4.0 FATAL_ERROR) # Should be string-colored</span>
28+
<span class="Comment">]]</span>
2929

3030
<span class="Comment">#[[</span>
31-
<span class="Comment">cmake_minimum_required(VERSION 4.0 FATAL_ERROR) # Should be greyed out</span>
32-
<span class="Comment">]]</span> <span class="Identifier">target_link_libraries</span>(t lib)
31+
<span class="Identifier">cmake_minimum_required</span>(<span class="ModeMsg">VERSION</span> 4.0 <span class="ModeMsg">FATAL_ERROR</span>) <span class="Comment"># Should be greyed out</span>
32+
]] <span class="Identifier">target_link_libraries</span>(t lib)
3333

3434
<span class="Comment">#[[</span>
35-
<span class="Comment">cmake_minimum_required(VERSION 4.0 FATAL_ERROR) # Should be greyed out</span>
36-
<span class="Comment">#]]</span> <span class="Identifier">target_link_libraries</span>(t lib)
35+
<span class="Identifier">cmake_minimum_required</span>(<span class="ModeMsg">VERSION</span> 4.0 <span class="ModeMsg">FATAL_ERROR</span>) <span class="Comment"># Should be greyed out</span>
36+
<span class="Comment">#]] target_link_libraries(t lib)</span>
3737

3838
<span class="Comment"># commented bracket-comment</span>
3939
<span class="Comment">##[[</span>
4040
<span class="Identifier">cmake_minimum_required</span>(<span class="ModeMsg">VERSION</span> 4.0 <span class="ModeMsg">FATAL_ERROR</span>) <span class="Comment"># Should not be greyed out</span>
4141
<span class="Comment">#]]</span>
4242

4343
<span class="Comment">#[[This is a bracket comment.</span>
44-
<span class="Comment">It runs until the close bracket.]]</span>
44+
It runs until the close bracket.]]
4545

46-
<span class="Identifier">message</span>(<span class="Constant">&quot;First Argument</span><span class="Special">\n</span><span class="Constant">&quot;</span> <span class="Comment">#[[Bracket Comment]]</span> <span class="Constant">&quot;Second Argument&quot;</span>)
46+
<span class="Identifier">message</span>(<span class="Constant">&quot;First Argument</span><span class="Special">\n</span><span class="Constant">&quot;</span> <span class="Comment">#[[Bracket Comment]] &quot;Second Argument&quot;)</span>
4747

48-
<span class="Comment">#[=12[</span>
49-
<span class="Comment">comment</span>
50-
<span class="Comment">]=12]</span>
48+
<span class="Comment">#[=[</span>
49+
comment
50+
]=]
5151

5252
</pre>
5353
</body>

0 commit comments

Comments
 (0)