ミ,,゚Д゚彡DelフサギコのフサフサDelphi談話室�A
■ このスレッドは過去ログ倉庫に格納されています
0865デフォルトの名無しさん
NGNGtype TCommentLineProc=procedure (str:String) of object;
procedure CommentProc(str:string;func:TCommentLineProc);
var lineno,n,cnt:Integer;
nowc:Char;
function getn:char;
begin
if n>cnt then Result:=#0
else begin Result:=str[n]; inc(n);end;
nowc:=Result;
end;
procedure comfunc(st:Integer;ed:string);
begin
while n <=cnt do begin
if ByteType(str,n)= mbLeadByte then begin
inc(n,2);
continue;
end;
if getn=ed[1] then begin
if (ed[2]=#0) or (getn=ed[1]) then break;
end;
end;
func(copy(str,st,(n-st) ));
end;
begin
cnt:=Length(str);
n:=1;
while n <=cnt do begin
if ByteType(str,n)= mbLeadByte then begin
inc(n,2);
continue;
end;
getn;
case nowc of
'(': if getn='*' then comfunc(n-2,'*)');
'{': comfunc(n-1,'}'#0);
'/': if getn='/' then comfunc(n-2,#13#0);
'''': begin
while getn<>'''' do if n>cnt then break;
end;
end;
end;
end;
■ このスレッドは過去ログ倉庫に格納されています