设计器
优化tfm文件读取,优化设计器中载入窗口闪烁问题
This commit is contained in:
@@ -136,6 +136,23 @@ type TTmfParserToken = class(TTmfParserbase)
|
||||
{**
|
||||
@explan(说明) 处理当前字符 %%
|
||||
**}
|
||||
if n=TT_STR then
|
||||
begin
|
||||
r[len++]:= array(ct,n);
|
||||
ct := "";
|
||||
end else
|
||||
begin
|
||||
if not(ct) then return ;
|
||||
if n=TT_NUM then
|
||||
begin
|
||||
if pos(".",ct)then ct := strtofloat(ct);
|
||||
else ct := strtoint(ct);
|
||||
end else
|
||||
if n=TT_SYM then ct := lowercase(ct);
|
||||
r[len++]:= array(ct,n);
|
||||
ct := "";
|
||||
end
|
||||
return ;
|
||||
if ct or(n=TT_STR)then
|
||||
begin
|
||||
if n=TT_NUM then
|
||||
@@ -249,6 +266,7 @@ type TTmfParserToken = class(TTmfParserbase)
|
||||
pnumber := true;
|
||||
kb := array(" ":1,"\t":1,"\r":1,"\n":1);
|
||||
fgf := array(' ':1,'\t':1,"\r":1,"\n":1,";":1,",":1);
|
||||
sns := array("=":1,":":1,"(":1,")":1,"<":1,">":1,"[":1,"]":1);
|
||||
while whileok() do
|
||||
begin
|
||||
c := cchar();
|
||||
@@ -298,7 +316,7 @@ type TTmfParserToken = class(TTmfParserbase)
|
||||
// delct(r,c,len,TT_SIG);
|
||||
// pnumber := true;
|
||||
// end else
|
||||
if c in array("=",":","(",")","<",">","[","]")then
|
||||
if sns[c]then
|
||||
begin
|
||||
delct(r,ct,len,TT_SYM);
|
||||
delct(r,c,len,TT_SIG);
|
||||
@@ -374,7 +392,9 @@ type TTmfParserToken = class(TTmfParserbase)
|
||||
end
|
||||
r += c;
|
||||
end
|
||||
return eval(&("0x"+r));
|
||||
if r then
|
||||
return eval(&("0x"+r));
|
||||
return 0;
|
||||
end else
|
||||
begin
|
||||
cback();
|
||||
@@ -387,18 +407,17 @@ type TTmfParserToken = class(TTmfParserbase)
|
||||
@explan(说明) 解析数字 %%
|
||||
**}
|
||||
r := "";
|
||||
its := inttostr(0 -> 9);
|
||||
its[length(its)]:= ".";
|
||||
kb := array(" ":1,"\t":1,"\r":1,"\n":1);
|
||||
while whileok() do
|
||||
begin
|
||||
c := cchar();
|
||||
if(c in array(" ","\t","\r","\n"))then break;
|
||||
if(kb[c] )then break;
|
||||
if c="l" or c="L" then
|
||||
begin
|
||||
cchar();
|
||||
break;
|
||||
end
|
||||
if not(c in its)then break;
|
||||
if not(c="." or FNumbers[c])then break;
|
||||
r += c;
|
||||
end
|
||||
cback();
|
||||
|
||||
Reference in New Issue
Block a user