-
Notifications
You must be signed in to change notification settings - Fork 620
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
Clean matlab testcases #1792
Clean matlab testcases #1792
Conversation
Make it a complete, but silly, functional Matlab class without warnings issued by the built-in linter in the Matlab editor. Add some comments and arguments to functions to stress the parser even more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much. However, could you move back the directories that has "tg" in their names?
These test cases are there in historical reason.
If your are interested in the history, see #38 .
About matlab_backtracking.m.t and matlab_test.m.t,
could you change their extention (.t) to .d when moving them to parser-matlab.r.
I made small requests to revise but the most of all parts are good. |
220ed14
to
0135248
Compare
Makes sense, I hope I got it right now. |
Thank you. I will merge this after appveyor says o.k. Your two pull requests show you have gift to read broken English:-)
I will show some examples next. |
Here is an example of the more complicated parser.
|
It looks very nice! However, I think I need to stop here, at least for now. With the addition of recognizing classes I now have what I need for jumping around Matlab code in Vim, which is my use case. One note about scope, and the keyword classdef input < handle
methods(Static)
function classfunc3;
for n=1:10
if n%2 == 0
A = magic(4);
R = randn(3,4,5);
disp('A:');
disp(A);
disp('R:');
disp(R);
end
end
end
end
end What would be nice though to support is class properties: classdef input < handle
properties (Access = private)
Data
end
methods
function classfunc3(p)
disp(p.Data);
end
end
end But in practice properties are often given an initial value, which let them be captured as classdef input < handle
properties (Access = private)
Data = [];
end
end But as I said, don't hold your breath for new PRs from me, right now :( |
I see. Thank you. Feel free to visit this project and repository again to improve the matlab parser! |
Re-work the synthetic test case
matlab_test.m.t
a bit to make it morerealistic and stress the parser a bit more.
In addition, collect all Matlab unit tests in a new category
parser-matlab.r
.I'm not completely sure if the test
Units/noext-tg-matlab.d
should beincluded in
parser-matlab.r
or not, as the point (if I assume correct)is that the language should be guessed in that case. It is included now.