codetools: fixed parsing var type with initial values

git-svn-id: trunk@14543 -
This commit is contained in:
mattias 2008-03-15 22:03:28 +00:00
parent 38f016b913
commit 55e69f1c40
2 changed files with 5 additions and 1 deletions

View File

@ -1161,6 +1161,7 @@ function TCCodeParserTool.ExtractVariableType(VarNode: TCodeTreeNode;
WithDirectives: boolean): string;
var
NameNode: TCodeTreeNode;
s: String;
begin
NameNode:=VarNode.FirstChild;
if (NameNode=nil) or (NameNode.Desc<>ccnVariableName) then
@ -1177,8 +1178,10 @@ begin
and (NameNode.NextBrother.Desc=ccnConstant) then begin
// a variable with an initial value
// omit the constant
Result:=Result+ExtractCode(NameNode.EndPos,NameNode.NextBrother.StartPos,
s:=ExtractCode(NameNode.EndPos,NameNode.NextBrother.StartPos,
WithDirectives);
s:=copy(s,1,length(s)-1);
Result:=Result+s;
end else begin
Result:=Result+ExtractCode(NameNode.EndPos,VarNode.EndPos,
WithDirectives);

View File

@ -236,6 +236,7 @@ begin
DebugLn(['TH2PasTool.BuildH2PTree Variable Name="',CurName,'" Type="',CurType,'" SimpleType=',SimpleType]);
if SimpleType='' then begin
// this variable has a complex type
end;
end;
ccnEnumBlock: