mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-03 04:38:13 +02:00
codetools: fixed parsing var type with initial values
git-svn-id: trunk@14543 -
This commit is contained in:
parent
38f016b913
commit
55e69f1c40
@ -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);
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user