Skip to content
Open
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
4 changes: 2 additions & 2 deletions Matlab.tmbundle/Syntaxes/MATLAB.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -2583,7 +2583,7 @@
<key>name</key>
<string>constant.numeric.decimal.matlab</string>
<key>match</key>
<string>(?&lt;=[\s\+\-\*\/\\=:\[\(\{,^]|^)\d*\.?\d+([eE][+-]?\d)?([0-9&amp;&amp;[^\.]])*(i|j)?\b</string>
<string>(?&lt;=[\s\+\-\*\/\\=;:\[\(\{,^]|^)\d*\.?\d+([eE][+-]?\d)?([0-9&amp;&amp;[^\.]])*(i|j)?\b</string>
<key>captures</key>
<dict>
<key>3</key>
Expand Down Expand Up @@ -2772,7 +2772,7 @@
<key>comment</key>
<string>Handle things like arg = val; nextArg</string>
<key>match</key>
<string>(=[^;]*)</string>
<string>(=(?:[^{\[;]+|\[[^\]]*\]|\{[^}]*\})*)</string>
<key>captures</key>
<dict>
<key>1</key>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"testGrammar": "vscode-tmgrammar-test -s source.matlab -g Matlab.tmbundle/Syntaxes/MATLAB.tmLanguage -t \"./test/*.m\"",
"testGrammarSnap": "vscode-tmgrammar-snap -s source.matlab -g Matlab.tmbundle/Syntaxes/MATLAB.tmLanguage -t \"./test/snap/*.m\"",
"testLintXML": "xmllint --noout \"Matlab.tmbundle/Syntaxes/MATLAB.tmLanguage\" && echo \"xmllint passed on MATLAB.tmLanguage\"",
"test": "npm run testLintXML && npm run testGrammar && npm run testGrammarSnap",
"test": "(npm run testLintXML && npm run testGrammar && npm run testGrammarSnap && echo \"All grammar tests passed\") || echo \"Error: One or more tests failed\"",
"updateGrammarSnap": "vscode-tmgrammar-snap -s source.matlab -g Matlab.tmbundle/Syntaxes/MATLAB.tmLanguage -t \"./test/snap/*.m\" -u"
},
"repository": {
Expand Down
17 changes: 17 additions & 0 deletions test/t101ArrayProperty.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
% SYNTAX TEST "source.matlab" "Array property parsing: https://github.com/mathworks/MATLAB-Language-grammar/issues/101"
classdef Foo
properties
mat1 = [1 1; 1 1];
% ^ constant.numeric.decimal.matlab
% ^ punctuation.section.brackets.end.matlab
mat2 = [1;1];
% ^ constant.numeric.decimal.matlab
% ^ punctuation.section.brackets.end.matlab
arr1 = {1 1; 1 1};
% ^ constant.numeric.decimal.matlab
% ^ punctuation.section.braces.end.matlab
arr2 = {1;1};
% ^ constant.numeric.decimal.matlab
% ^ punctuation.section.braces.end.matlab
end
end