You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
We cannot differentiate between a constant section and a resourcestringsection. #228
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:
procedureTPasSyntaxTreeBuilder.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);
tryinherited;
finally
FStack.Pop;
end;
for ConstList in ConstSect.ChildNodes dobegin
TypeInfo := ConstList.FindNode(ntType);
Value := ConstList.FindNode(ntValue);
for Constant in ConstList.ChildNodes dobeginif 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;
Activity
RomanYankovsky#228 differentiate between const and resourcestring sec…