More robust heuristics for .m files and 3 new Matlab tests. Support for Obj-C detection fully intact; all tests pass. Detection of Obj-C keywords @implementation, @property, @interface, and @synthesize removed to avoid possible conflicts with user-created Matlab function handles. Only @end is needed, which is not valid in Matlab. Matlab class files supported. Comments preceded by whitespace detected for Obj-C and Matlab.

Signed-off-by: Andrew D. Horchler <adh9@case.edu>
This commit is contained in:
Andrew D. Horchler
2012-05-08 18:29:34 -04:00
parent f0eace7f86
commit 354e1fc85e
5 changed files with 90 additions and 10 deletions

33
test/fixtures/matlab_function2.m vendored Normal file
View File

@@ -0,0 +1,33 @@
function ret = matlab_function2(A,B)
% Simple function that combines two values using function handles and displays
% the return value
% create function handles
fun1=@interface;
fun2=@implementation;
fun3=@property;
fun4=@synthesize;
% use function handles
ret = fun1(A)+fun2(A)+fun3(B)+fun4(B);
% Display the return value
disp('Return value in function');
disp(ret);
function A=interface(A)
% simple sub-function with same name Objective-C @keyword
A=2*A;
function A=implementation(A)
% simple sub-function with same name Objective-C @keyword
A=A^2;
function B=property(B)
% simple sub-function with same name Objective-C @keyword
B=2*B;
function B=synthesize(B)
% simple sub-function with same name Objective-C @keyword
B=B^2;