RomanYankovsky / DelphiAST

Abstract syntax tree builder for Delphi
Mozilla Public License 2.0
271 stars 116 forks source link

ntType nodes are inconsistent in their attributes #240

Open JBontes opened 6 years ago

JBontes commented 6 years ago

The ntType node sometimes stores its type in a anName attribute and sometimes in a anType attribute.

The relevant data should be stored in one or the other.

Example:

procedure TPasSyntaxTreeBuilder.StringStatement;
begin
  FStack.AddChild(ntType).Attribute[anName]:= Lexer.Token;
  inherited;
end;

procedure TPasSyntaxTreeBuilder.StructuredType;
begin
  FStack.Push(ntType).Attribute[anType]:= Lexer.Token;
  try
    inherited;
  finally
    FStack.Pop;
  end;
end;