diff --git a/components/codetools/ccodeparsertool.pas b/components/codetools/ccodeparsertool.pas index d2b8620d2f..221722cb34 100644 --- a/components/codetools/ccodeparsertool.pas +++ b/components/codetools/ccodeparsertool.pas @@ -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); diff --git a/components/codetools/h2pastool.pas b/components/codetools/h2pastool.pas index e3ecde5eb6..e4d22fe4dd 100644 --- a/components/codetools/h2pastool.pas +++ b/components/codetools/h2pastool.pas @@ -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: