2023-07-25 18:44:32 +02:00
|
|
|
% Copyright (C) 2023 Eric Ludlam (and others)
|
|
|
|
|
|
|
|
% This program is free software: you can redistribute it and/or modify
|
|
|
|
% it under the terms of the GNU General Public License as published by
|
|
|
|
% the Free Software Foundation, either version 3 of the License, or
|
|
|
|
% (at your option) any later version.
|
|
|
|
|
|
|
|
% This program is distributed in the hope that it will be useful,
|
|
|
|
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
% GNU General Public License for more details.
|
|
|
|
|
|
|
|
% You should have received a copy of the GNU General Public License
|
|
|
|
% along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2021-03-24 00:23:08 +01:00
|
|
|
|
|
|
|
% TEST FILE FOR FONT LOCK SPECIAL WORDS
|
|
|
|
function fontlock()
|
|
|
|
%^ ^kw ^fn ^df
|
2021-03-26 17:46:34 +01:00
|
|
|
%^ ^ig
|
2021-03-24 00:23:08 +01:00
|
|
|
|
2021-03-26 17:46:34 +01:00
|
|
|
% $$$ ignored comment
|
|
|
|
%^ ^ig
|
|
|
|
|
2021-03-25 02:43:56 +01:00
|
|
|
persistent var1 % !!4
|
|
|
|
%^ ^kw ^vn ^co
|
|
|
|
|
|
|
|
global var2 % !!4
|
|
|
|
%^ ^kw ^vn ^co
|
|
|
|
|
2021-03-24 00:23:08 +01:00
|
|
|
end
|
|
|
|
%^ ^kw
|
|
|
|
|
|
|
|
function [ var1, var2 ] = local(input1)
|
|
|
|
%^ ^kw ^vn ^fn ^vn ^df
|
2019-11-09 18:01:34 +01:00
|
|
|
|
2021-03-24 00:23:08 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
function [a, b] = local2(input1,...
|
|
|
|
input2)
|
|
|
|
%^ ^vn
|
|
|
|
end
|
|
|
|
|
|
|
|
% TODO - these are cross function variables, but we turn off mlint in
|
|
|
|
% tests, so these aren't tested.
|
|
|
|
function [a, b, c] = localvars(input1, input2, input3)
|
|
|
|
%^ ^kw ^vn ^fn ^vn ^vn ^vn ^df
|
|
|
|
|
2019-11-09 18:01:34 +01:00
|
|
|
nested(input1);
|
|
|
|
|
|
|
|
q = input2;
|
|
|
|
r = input3;
|
|
|
|
|
|
|
|
function nested(ni1)
|
|
|
|
% Nest function comment
|
|
|
|
|
|
|
|
b = ni1;
|
|
|
|
a = q;
|
|
|
|
c = r;
|
|
|
|
|
|
|
|
end
|
2021-03-24 00:23:08 +01:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
function keywordstuff()
|
|
|
|
|
|
|
|
while true
|
2021-03-26 23:52:45 +01:00
|
|
|
%^ ^kw ^ma
|
2021-03-24 00:23:08 +01:00
|
|
|
|
|
|
|
for varname=1:10
|
2021-03-25 02:43:56 +01:00
|
|
|
%^ ^kw ^vn ^cn
|
2021-03-24 00:23:08 +01:00
|
|
|
break
|
2021-03-25 02:43:56 +01:00
|
|
|
%^ ^kw
|
2021-03-24 00:23:08 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
if varname == 2
|
2021-03-26 23:52:45 +01:00
|
|
|
%^ ^kw ^df ^bi ^df
|
2021-03-24 00:23:08 +01:00
|
|
|
disp(1)
|
|
|
|
elseif varname==3
|
2021-03-26 23:52:45 +01:00
|
|
|
%^ ^kw ^df ^bi
|
2021-03-24 00:23:08 +01:00
|
|
|
disp(2)
|
|
|
|
else
|
2021-03-25 02:43:56 +01:00
|
|
|
%^ ^kw
|
2021-03-24 00:23:08 +01:00
|
|
|
disp(3)
|
|
|
|
end
|
2021-03-25 02:43:56 +01:00
|
|
|
%^ ^kw
|
2021-03-24 00:23:08 +01:00
|
|
|
|
|
|
|
switch varname
|
2021-03-25 02:43:56 +01:00
|
|
|
%^ ^kw ^cn
|
2021-03-24 00:23:08 +01:00
|
|
|
case 1
|
2021-03-25 02:43:56 +01:00
|
|
|
%^ ^kw ^cn
|
2021-03-24 00:23:08 +01:00
|
|
|
disp(1)
|
|
|
|
continue
|
2021-03-25 02:43:56 +01:00
|
|
|
%^ ^kw
|
2021-03-24 00:23:08 +01:00
|
|
|
case 2
|
2021-03-25 02:43:56 +01:00
|
|
|
%^ ^kw ^cn
|
2021-03-24 00:23:08 +01:00
|
|
|
disp(2)
|
|
|
|
otherwise
|
2021-03-25 02:43:56 +01:00
|
|
|
%^ ^kw
|
2021-03-24 00:23:08 +01:00
|
|
|
disp('other');
|
2021-03-25 02:43:56 +01:00
|
|
|
%^ ^df ^st
|
2021-03-24 00:23:08 +01:00
|
|
|
return
|
2021-03-25 02:43:56 +01:00
|
|
|
%^ ^kw
|
2021-03-24 00:23:08 +01:00
|
|
|
end
|
2021-03-25 02:43:56 +01:00
|
|
|
%^ ^kw
|
2021-03-24 00:23:08 +01:00
|
|
|
|
|
|
|
try
|
2021-03-25 02:43:56 +01:00
|
|
|
%^ ^kw
|
2021-03-24 00:23:08 +01:00
|
|
|
disp(1)
|
|
|
|
catch
|
2021-03-25 02:43:56 +01:00
|
|
|
%^ ^kw
|
2021-03-24 00:23:08 +01:00
|
|
|
disp(2)
|
|
|
|
end
|
2021-03-25 02:43:56 +01:00
|
|
|
%^ ^kw
|
2021-03-24 00:23:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function dographics(value)
|
|
|
|
|
|
|
|
f = figure;
|
2021-03-26 23:52:45 +01:00
|
|
|
%^ ^bi
|
2021-03-24 00:23:08 +01:00
|
|
|
ax = axes(f);
|
2021-03-26 23:52:45 +01:00
|
|
|
%^ ^bi
|
2021-03-24 00:23:08 +01:00
|
|
|
|
|
|
|
set ( ax, 'property',value)
|
2021-03-26 23:52:45 +01:00
|
|
|
%^ ^bi ^vn ^st
|
2021-03-24 00:23:08 +01:00
|
|
|
|
2021-03-26 23:52:45 +01:00
|
|
|
s = open_system('foo.mdl');
|
|
|
|
%^ ^si ^st
|
|
|
|
|
|
|
|
set_param(s, 'param', value);
|
|
|
|
%^ ^si ^vn ^st ^df
|
2021-03-24 00:23:08 +01:00
|
|
|
end
|
2019-11-09 18:01:34 +01:00
|
|
|
|
2021-03-24 00:23:08 +01:00
|
|
|
function dodebug()
|
2021-03-25 03:08:52 +01:00
|
|
|
|
|
|
|
dbstop in dodebug
|
|
|
|
%^ ^bo ^cd
|
2021-03-24 00:23:08 +01:00
|
|
|
|
|
|
|
dbclear
|
2021-03-25 02:43:56 +01:00
|
|
|
%^ ^bo
|
2019-11-09 18:01:34 +01:00
|
|
|
|
|
|
|
end
|
2021-03-24 22:24:36 +01:00
|
|
|
|
2021-03-24 00:23:08 +01:00
|
|
|
function mathstuff()
|
|
|
|
|
|
|
|
myvar = eps + pi + nan + ans + i + NaT + true ;
|
2021-03-26 23:52:45 +01:00
|
|
|
%^ ^df ^ma ^bi ^ma ^bi ^ma ^bi ^ma ^bi ^ma ^bi ^ma ^bi ^ma ^df
|
2021-03-24 00:23:08 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
function helptest()
|
2021-03-26 23:52:45 +01:00
|
|
|
% HELPTEXT has fancy fonts in it.
|
2021-03-24 00:23:08 +01:00
|
|
|
%^ ^cn
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2021-04-03 02:31:55 +02:00
|
|
|
function name_no_args
|
|
|
|
%^ ^kw ^fn
|
|
|
|
end
|
|
|
|
|
|
|
|
function retarg = ret_and_name_no_args % comment
|
|
|
|
%^ ^kw ^vn ^df ^fn ^co
|
|
|
|
end
|
|
|
|
|
|
|
|
function retarg = args_have_cont (arg_1, ...
|
|
|
|
arg_2)
|
|
|
|
%^ ^vn
|
|
|
|
end
|
|
|
|
|
|
|
|
function [ retarg1, ...
|
|
|
|
retarg2, ...
|
|
|
|
retarg3 ] ...
|
|
|
|
= name_of_fcn (arg1)
|
|
|
|
%^ ^df ^fn ^vn ^df
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2021-03-24 22:24:36 +01:00
|
|
|
classdef (Abstract) myclass < handle
|
2021-03-26 23:52:45 +01:00
|
|
|
%^ ^kw ^ty ^fn ^bi ^cn
|
2021-03-24 22:24:36 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
classdef (Abstract)myclass<handle
|
2021-03-26 23:52:45 +01:00
|
|
|
%^ ^kw ^ty ^fn ^bi ^ty
|
2021-03-24 22:24:36 +01:00
|
|
|
end
|
|
|
|
|
2021-03-24 00:23:08 +01:00
|
|
|
%{
|
|
|
|
% Local Variables:
|
|
|
|
% matlab-show-mlint-warnings: nil
|
|
|
|
% End:
|
|
|
|
%}
|
|
|
|
|