Handle untyped properties

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2507 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
inoussa
2012-09-06 12:31:10 +00:00
parent 2228ea0aa5
commit 80b84e6c7d

View File

@ -257,7 +257,7 @@ var
typNode : TDOMNode; typNode : TDOMNode;
begin begin
if not AEltNode.HasChildNodes() then begin; if not AEltNode.HasChildNodes() then begin;
raise EXsdParserException.Create(AEltNode.NodeName+' : '+SERR_InvalidTypeDef_NoChild); raise EXsdParserException.CreateFmt('%s : Type Name = "%s", NodeName = "%s" .',[SERR_InvalidTypeDef_NoChild,ATypeName,AEltNode.NodeName]);
end; end;
typName := ATypeName; typName := ATypeName;
if IsStrEmpty(typName) then begin if IsStrEmpty(typName) then begin
@ -942,14 +942,18 @@ var
locTypeHint := ExtractTypeHint(AElement); locTypeHint := ExtractTypeHint(AElement);
end else begin end else begin
locTypeName := Format('%s_%s_Type',[FTypeName,locName]); locTypeName := Format('%s_%s_Type',[FTypeName,locName]);
locType := TAbstractTypeParser.ExtractEmbeddedTypeFromElement(Context,AElement,FSymbols,locTypeName); if AElement.HasChildNodes() then begin
if ( locType = nil ) then begin locType := TAbstractTypeParser.ExtractEmbeddedTypeFromElement(Context,AElement,FSymbols,locTypeName);
raise EXsdInvalidElementDefinitionException.CreateFmt(SERR_InvalidElementDef_Type,[FTypeName,locName]); if ( locType = nil ) then begin
end; raise EXsdInvalidElementDefinitionException.CreateFmt(SERR_InvalidElementDef_Type,[FTypeName,locName]);
Self.Module.InterfaceSection.Declarations.Add(locType); end;
Self.Module.InterfaceSection.Types.Add(locType); Self.Module.InterfaceSection.Declarations.Add(locType);
if locType.InheritsFrom(TPasClassType) then begin Self.Module.InterfaceSection.Types.Add(locType);
Self.Module.InterfaceSection.Classes.Add(locType); if locType.InheritsFrom(TPasClassType) then begin
Self.Module.InterfaceSection.Classes.Add(locType);
end;
end else begin
locTypeName := 'anyType';
end; end;
end; end;
end; end;
@ -1667,7 +1671,7 @@ function TSimpleTypeParser.ParseEnumContent(): TPasType;
var var
locRes : TPasEnumType; locRes : TPasEnumType;
locOrder : Integer; //locOrder : Integer;
prefixItems : Boolean; prefixItems : Boolean;
procedure ParseEnumItem(AItemNode : TDOMNode); procedure ParseEnumItem(AItemNode : TDOMNode);
@ -1709,11 +1713,11 @@ var
end; end;
end; end;
locItem := TPasEnumValue(FSymbols.CreateElement(TPasEnumValue,locInternalItemName,locRes,visDefault,'',0)); locItem := TPasEnumValue(FSymbols.CreateElement(TPasEnumValue,locInternalItemName,locRes,visDefault,'',0));
locItem.Value := locOrder; //locItem.Value := locOrder;
locRes.Values.Add(locItem); locRes.Values.Add(locItem);
if locHasInternalName then if locHasInternalName then
FSymbols.RegisterExternalAlias(locItem,locItemName); FSymbols.RegisterExternalAlias(locItem,locItemName);
Inc(locOrder); //Inc(locOrder);
end; end;
var var
@ -1736,7 +1740,7 @@ begin
if hasIntrnName then if hasIntrnName then
FSymbols.RegisterExternalAlias(locRes,FTypeName); FSymbols.RegisterExternalAlias(locRes,FTypeName);
locEnumCrs.Reset(); locEnumCrs.Reset();
locOrder := 0; //locOrder := 0;
while locEnumCrs.MoveNext() do begin while locEnumCrs.MoveNext() do begin
ParseEnumItem((locEnumCrs.GetCurrent() as TDOMNodeRttiExposer).InnerObject); ParseEnumItem((locEnumCrs.GetCurrent() as TDOMNodeRttiExposer).InnerObject);
end; end;