界面库

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