"CaseSensitive" fixes.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2144 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
inoussa
2011-11-15 19:11:17 +00:00
parent 03b5e24fc4
commit e4e3f34376
6 changed files with 26 additions and 14 deletions

View File

@ -123,11 +123,11 @@ begin
cltyp.ObjKind := okClass;
mdl.InterfaceSection.Declarations.Add(cltyp);
mdl.InterfaceSection.Types.Add(cltyp);
AddProperty('intField','integer','1210',ptField);
AddProperty('intField','int','1210',ptField);
AddProperty('strField','string','azerty',ptField);
AddProperty('floatField','float','1234',ptField);
AddProperty('strAtt','string','attribute azerty',ptAttribute);
AddProperty('intAtt','integer','789',ptAttribute);
AddProperty('intAtt','int','789',ptAttribute);
locDoc := CreateDoc();
g := CreateGenerator(locDoc);
@ -193,12 +193,12 @@ begin
cltyp.ObjKind := okClass;
mdl.InterfaceSection.Declarations.Add(cltyp);
mdl.InterfaceSection.Types.Add(cltyp);
p := AddProperty('intField','integer','',ptField,'uri-4#a','1210');
p := AddProperty('intField','int','',ptField,'uri-4#a','1210');
tr.Properties.SetValue(p,'uri-4#b','uri-5#xx');
AddProperty('strField','string','azerty',ptField,'uri-4#a','http://www.w3.org/2001/XMLSchema#int');
AddProperty('floatField','float','',ptField,'','');
AddProperty('strAtt','string','attribute azerty',ptAttribute,'uri-4#a','optional');
AddProperty('intAtt','integer','',ptAttribute,'','');
AddProperty('intAtt','int','',ptAttribute,'','');
locDoc := CreateDoc();
g := CreateGenerator(locDoc);
@ -260,7 +260,7 @@ begin
cltyp.AncestorType.AddRef();
mdl.InterfaceSection.Declarations.Add(cltyp);
mdl.InterfaceSection.Types.Add(cltyp);
AddProperty('intAtt','integer','',ptAttribute);
AddProperty('intAtt','int','',ptAttribute);
cltyp := TPasClassType(tr.CreateElement(TPasClassType,'TExtendBase64String',mdl.InterfaceSection,visDefault,'',0));
cltyp.ObjKind := okClass;
@ -337,11 +337,11 @@ begin
cltyp.AncestorType.AddRef();
mdl.InterfaceSection.Declarations.Add(cltyp);
mdl.InterfaceSection.Types.Add(cltyp);
AddProperty('intField','integer','',ptField);
AddProperty('intField','int','',ptField);
AddProperty('strField','string','',ptField);
AddProperty('floatField','float','',ptField);
AddProperty('strAtt','string','',ptAttribute);
AddProperty('intAtt','integer','',ptAttribute);
AddProperty('intAtt','int','',ptAttribute);
locDoc := CreateDoc();
g := CreateGenerator(locDoc);
@ -404,7 +404,7 @@ begin
mdl.InterfaceSection.Declarations.Add(cltyp);
mdl.InterfaceSection.Types.Add(cltyp);
AddProperty('strAtt','string','',ptAttribute);
AddProperty('intAtt','integer','',ptAttribute);
AddProperty('intAtt','int','',ptAttribute);
locDoc := CreateDoc();
g := CreateGenerator(locDoc);

View File

@ -337,6 +337,7 @@ end;
function TTest_CustomXsdParser.ParseDoc(const ADoc: string): TwstPasTreeContainer;
begin
Result := ParseDoc(ADoc,False);
Result.DefaultSearchNameKinds := NAME_KINDS_DEFAULT;
end;
procedure TTest_CustomXsdParser.EmptySchema();
@ -779,7 +780,7 @@ begin
CheckIs(elt,TPasClassType);
clsType := elt as TPasClassType;
CheckNotNull(clsType.AncestorType,'AncestorType is null');
CheckSame(tr.FindElementNS('TComplexStringContentRemotable',sXSD_NS),clsType.AncestorType);
CheckSame(tr.FindElementNS('TComplexStringContentRemotable',sXSD_NS),clsType.AncestorType,clsType.AncestorType.Name);
prpLs.Clear();
for i := 0 to Pred(clsType.Members.Count) do begin

View File

@ -3261,9 +3261,15 @@ var
oldCurrent, mdl : TPasModule;
i : PtrInt;
mdlList : TList;
oldCS : Boolean;
oldNamesKinds : TElementNameKinds;
begin
oldCS := SymbolTable.CaseSensitive;
oldNamesKinds := SymbolTable.DefaultSearchNameKinds;
oldCurrent := SymbolTable.CurrentModule;
try
SymbolTable.CaseSensitive := False;
SymbolTable.DefaultSearchNameKinds := [elkName];
mdlList := SymbolTable.Package.Modules;
for i := 0 to Pred(mdlList.Count) do begin
mdl := TPasModule(mdlList[i]);
@ -3275,6 +3281,8 @@ begin
end;
finally
SymbolTable.SetCurrentModule(oldCurrent);
SymbolTable.CaseSensitive := oldCS;
SymbolTable.DefaultSearchNameKinds := oldNamesKinds;
end;
end;

View File

@ -326,6 +326,8 @@ procedure AddSystemSymbol(
ADest.InterfaceSection.Declarations.Add(splTyp);
ADest.InterfaceSection.Types.Add(splTyp);
typlst[i] := splTyp;
end;
for i := Low(SIMPLE_TYPES) to High(SIMPLE_TYPES) do begin
s := SIMPLE_TYPES[i][1];
if not IsStrEmpty(s) then begin
syb := AContainer.FindElementInModule(SIMPLE_TYPES[i][1],ADest) as TPasNativeSimpleContentClassType;
@ -334,7 +336,7 @@ procedure AddSystemSymbol(
ADest.InterfaceSection.Declarations.Add(syb);
ADest.InterfaceSection.Types.Add(syb);
end;
splTyp.SetExtendableType(syb);
typlst[i].SetExtendableType(syb);
end;
end;
for i := Low(SIMPLE_TYPES) to High(SIMPLE_TYPES) do begin
@ -483,6 +485,7 @@ begin
AddAlias('anyURI','string',Result);
AddAlias('ID','string',Result);
//AddAlias('float','Single',Result);
AddAlias('integer','int',Result);
AddAlias('nonNegativeInteger','LongWord',Result);
AddAlias('positiveInteger','nonNegativeInteger',Result);
{$IFNDEF WST_HAS_TDURATIONREMOTABLE}

View File

@ -196,8 +196,8 @@ destructor TWsdlParser.Destroy();
var
j : PtrInt;
begin
if Assigned(AList) then begin
for j := 0 to Pred(AList.Count) do begin
if Assigned(AList) and (AList.Count > 0) then begin
for j := Pred(AList.Count) downto 0 do begin
AList.Objects[j].Free();
AList.Objects[j] := nil;
end;

View File

@ -236,8 +236,8 @@ destructor TCustomXsdSchemaParser.Destroy();
var
j : PtrInt;
begin
if Assigned(AList) then begin
for j := 0 to Pred(AList.Count) do begin
if Assigned(AList) and (AList.Count > 0) then begin
for j := Pred(AList.Count) downto 0 do begin
AList.Objects[j].Free();
AList.Objects[j] := nil;
end;