Right now delphiAST does not register the difference between a const section and a resourcestring section.
We can fix this by adding an attribute to the ntConstants node so that we can see the difference.
Here's the fix:
procedure TPasSyntaxTreeBuilder.ConstSection;
var
ConstSect, Temp: TSyntaxNode;
ConstList, Constant, TypeInfo, Value: TSyntaxNode;
begin
ConstSect := TSyntaxNode.Create(ntConstants);
try
FStack.Push(ntConstants).SetAttribute(anKind, Lexer.Token);
FStack.Push(ConstSect);
try
inherited;
finally
FStack.Pop;
end;
for ConstList in ConstSect.ChildNodes do
begin
TypeInfo := ConstList.FindNode(ntType);
Value := ConstList.FindNode(ntValue);
for Constant in ConstList.ChildNodes do
begin
if Constant.Typ <> ntName then
Continue;
Temp := FStack.Push(ConstList.Typ);
try
Temp.AssignPositionFrom(Constant);
FStack.AddChild(Constant.Clone);
if Assigned(TypeInfo) then
FStack.AddChild(TypeInfo.Clone);
FStack.AddChild(Value.Clone);
finally
FStack.Pop;
end;
end;
end;
FStack.Pop;
finally
ConstSect.Free;
end;
end;
Right now delphiAST does not register the difference between a
const
section and aresourcestring
section. We can fix this by adding an attribute to thentConstants
node so that we can see the difference.Here's the fix: