设计器

修正解析死循环问题
This commit is contained in:
JianjunLiu 2023-07-07 18:02:40 +08:00
parent 9b2ad753fc
commit 33f5e8a47d
3 changed files with 13 additions and 2 deletions

View File

@ -1000,6 +1000,7 @@ type TExecuteEditer=class(TCustomControl) //ִ
s := replacetext(s,"$(CURRENT_DIRECTORY)",dir); s := replacetext(s,"$(CURRENT_DIRECTORY)",dir);
s := replacetext(s,"$(SEARCH_PATH)",owner.getlibpathstr()); s := replacetext(s,"$(SEARCH_PATH)",owner.getlibpathstr());
s := replacetext(s,"$(TSL_EXE)",gettslexe()); s := replacetext(s,"$(TSL_EXE)",gettslexe());
len := length(s);
return s; return s;
end end
function doSaveCurrentName(); function doSaveCurrentName();

View File

@ -39,7 +39,7 @@ type tslparser = class(tslparserbase) //
end end
function tkopok(); function tkopok();
begin begin
return FCurrentPos>0 and FCurrentPos<FTokenLen; return FCurrentPos>=0 and FCurrentPos<FTokenLen;
end end
function getTokenPos(ps); function getTokenPos(ps);
begin begin
@ -52,7 +52,7 @@ type tslparser = class(tslparserbase) //
function ctoken(tk,tp,pos,r); function ctoken(tk,tp,pos,r);
begin begin
if not FTokens then return 0; if not FTokens then return 0;
r := tkopok(pos); //r := tkopok(pos);
tk := FTokens[FCurrentPos,0]; tk := FTokens[FCurrentPos,0];
tp := FTokens[FCurrentPos,1]; tp := FTokens[FCurrentPos,1];
pos := FTokens[FCurrentPos,2]+1; pos := FTokens[FCurrentPos,2]+1;
@ -398,6 +398,12 @@ type tslparser = class(tslparserbase) //
while true do while true do
begin begin
ctoken(tk,tp,pos); ctoken(tk,tp,pos);
if ifnil(tk) then break;
if tk="end" and tp=TT_IDE then
begin
bpos();
break;
end
if tk=";" then if tk=";" then
begin begin
if rcount then if rcount then

View File

@ -454,6 +454,10 @@ type tcustompagecontrol = class(TCustomControl)
if FCurrentid=-1 then if FCurrentid=-1 then
begin begin
setselidx(0); setselidx(0);
end else
begin
if not (page is class(TWinControl)) then CalcTabs();
InvalidateRect(nil,false);
end end
end end
public public