Skip to content

Commit

Permalink
Updated the Matlab/Octave syntax with the last fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
evandrocoan committed Sep 30, 2016
1 parent f9b9bf4 commit 148f67f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Matlab/Matlab.sublime-syntax
Expand Up @@ -62,7 +62,7 @@ contexts:
scope: comment.double.percentage.matlab
captures:
1: punctuation.definition.comment.matlab
- match: '%\{'
- match: '%\{\s*\n'
captures:
1: punctuation.definition.comment.matlab
push:
Expand Down
28 changes: 24 additions & 4 deletions Matlab/syntax_test_matlab.m
Expand Up @@ -41,19 +41,39 @@
x = [ 1.76 ]
% <- source.matlab meta.variable.other.valid.matlab
% ^ source.matlab keyword.operator.symbols.matlab
% ^ source.matlab punctuation.definition.brackets.begin.matlab
% ^ source.matlab punctuation.section.brackets.begin.matlab
% ^ source.matlab meta.brackets.matlab constant.numeric.matlab
% ^ source.matlab punctuation.definition.brackets.end.matlab
% ^ source.matlab punctuation.section.brackets.end.matlab


xAprox = fMetodoDeNewton( xi )
% <- source.matlab meta.variable.other.valid.matlab
% ^ source.matlab keyword.operator.symbols.matlab
% ^ source.matlab meta.variable.other.valid.matlab
% ^ source.matlab punctuation.definition.parens.begin.matlab
% ^ source.matlab punctuation.section.parens.begin.matlab
% ^ source.matlab meta.parens.matlab meta.variable.other.valid.matlab
% ^ source.matlab punctuation.definition.parens.end.matlab
% ^ source.matlab punctuation.section.parens.end.matlab



%---------------------------------------------
% 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
%}

4 changes: 2 additions & 2 deletions Octave/Octave.sublime-syntax
Expand Up @@ -9,11 +9,11 @@ contexts:
- match: ''
push: Packages/Matlab/Matlab.sublime-syntax
with_prototype:
- match: '[#%]{.*\n'
- match: '[#%]{\s*\n'
scope: comment.line.octave
push:
- meta_scope: comment.line.octave
- match: '[#%]}.*\n'
- match: '[#%]}\s*\n'
scope: comment.line.octave
pop: true
- match: '#.*\n'
Expand Down

0 comments on commit 148f67f

Please sign in to comment.