Skip to content

Commit

Permalink
Merge pull request #650 from evandrocoan/matlab_block_comments
Browse files Browse the repository at this point in the history
[Matlab] Fixed the block comment scope for the Matlab syntax
  • Loading branch information
wbond committed Nov 22, 2016
2 parents ce847b2 + bd2f4b6 commit d2b0502
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Matlab/Matlab.sublime-syntax
Expand Up @@ -62,12 +62,12 @@ contexts:
scope: comment.double.percentage.matlab
captures:
1: punctuation.definition.comment.matlab
- match: '%\{'
- match: '(%\{)\s*\n'
captures:
1: punctuation.definition.comment.matlab
push:
- meta_scope: comment.block.percentage.matlab
- match: '%\}\s*\n'
- match: '(%\})\s*\n'
captures:
1: punctuation.definition.comment.matlab
pop: true
Expand Down
12 changes: 12 additions & 0 deletions Matlab/Miscellaneous.tmPreferences
Expand Up @@ -38,6 +38,18 @@
<key>value</key>
<string>% </string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_START_2</string>
<key>value</key>
<string>%{\n</string>
</dict>
<dict>
<key>name</key>
<string>TM_COMMENT_END_2</string>
<key>value</key>
<string>%}\n</string>
</dict>
</array>
<key>smartTypingPairs</key>
<array>
Expand Down
20 changes: 20 additions & 0 deletions Matlab/syntax_test_matlab.m
Expand Up @@ -56,4 +56,24 @@



%---------------------------------------------
% Block comment test

% Success case
%{
x = 5
% ^ source.matlab comment.block.percentage.matlab
%}

% Failure case
%{ fail
x = 5
% ^ source.matlab keyword.operator.symbols.matlab
%}

%{
%} fail
x = 5
% ^ source.matlab comment.block.percentage.matlab
%}

0 comments on commit d2b0502

Please sign in to comment.