界面库

tfm文件解析去掉关键字item
This commit is contained in:
JianjunLiu 2022-10-21 11:52:51 +08:00
parent b17bb2c85b
commit 7c79268504
1 changed files with 13 additions and 13 deletions

View File

@ -532,7 +532,7 @@ type TTmfParser = class(TTmfParserbase)
if ifstring(v)and(not v)then return tostn("");
if ifstring(v)then
begin
if v in array("item","end","object")then return tostn(v);
if v in array({"item",}"end","object")then return tostn(v);
if new TCharDiscrimi().IsVariableName(v)then
begin
return v;
@ -691,8 +691,8 @@ type TTmfParser = class(TTmfParserbase)
while whileok() do
begin
ctoken(tv,tt);
if tv="item" and(tt <> TT_STR)then return samplevalue(array("value":getabitem(tv),"type":TT_ITEM));
else if tv="<" and(tt <> TT_STR)then
{if tv="item" and(tt <> TT_STR)then return samplevalue(array("value":getabitem(tv),"type":TT_ITEM));
else }if tv="<" and(tt <> TT_STR)then
begin
v := getabitem(tv,fff);
lx := ffff?TT_COLL:TT_ITEM;
@ -749,11 +749,11 @@ type TTmfParser = class(TTmfParserbase)
begin
ctoken(tv,tt);
lx := tt;
if tv="item" and(tt <> TT_STR)then
{if tv="item" and(tt <> TT_STR)then
begin
lx := TT_ITEM;
val := getabitem();
end else
end else}
if tv="[" and(tt <> TT_STR)then
begin
lx := TT_SET;
@ -853,7 +853,7 @@ type TTmfParser = class(TTmfParserbase)
begin
ctoken(tv,tt);
if tv="]" and tt <> TT_STR then return r;
if tv="item" and tt <> TT_STR then r[rl++]:= array("value":getabitem(tv),"type":TT_ITEM);
//if tv="item" and tt <> TT_STR then r[rl++]:= array("value":getabitem(tv),"type":TT_ITEM);
else if tv="<" and tt <> TT_STR then
begin
v := getabitem(tv,fff);
@ -867,7 +867,7 @@ type TTmfParser = class(TTmfParserbase)
function getabitem(tp,ifitem);
begin
if not ifstring(tp)then endtp := "end";
else if tp="item" then endtp := "end";
//else if tp="item" then endtp := "end";
else if tp="<" then endtp := ">";
else PError("dict´íÎó",1);
r := array();
@ -886,12 +886,12 @@ type TTmfParser = class(TTmfParserbase)
if ifnil(val)or ifnil(lx)then PError("itemÎÞÖµ",1);
r[rl++]:= array("name":p,"value":val,"type":lx);
end else
if p="item" and ptt <> TT_STR and(length(r)<1)then
{if p="item" and ptt <> TT_STR and(length(r)<1)then
begin
ifitem := true;
btoken(2);
return getab();
end else
end else}
PError("itemûÓÐ=",1);
end
end
@ -909,10 +909,10 @@ type TTmfParser = class(TTmfParserbase)
begin
return r;
end else
if tv="item" and tt <> TT_STR then
{if tv="item" and tt <> TT_STR then
begin
r[rl++]:= getabitem();
end else
end else}
begin
return PError("<>ÄÚÈÝ´íÎó",1);
end
@ -937,8 +937,8 @@ type TTmfParser = class(TTmfParserbase)
begin
return r;
end else
if tv="item" and tt <> TT_STR then r[rl++]:= array("value":getabitem(tv),"type":TT_ITEM);
else if tv="<" and tt <> TT_STR then
{if tv="item" and tt <> TT_STR then r[rl++]:= array("value":getabitem(tv),"type":TT_ITEM);
else }if tv="<" and tt <> TT_STR then
begin
v := getabitem(tv,fff);
lx := fff?TT_COLL:TT_ITEM;