RomanYankovsky / DelphiAST

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

Hinting directives are not recorded #247

Open JBontes opened 6 years ago

JBontes commented 6 years ago

DelphiAST.pas does not record the hinting directives:

Fix:

procedure TPasSyntaxTreeBuilder.DirectiveDeprecated;
begin
  FStack.Push(ntDeprecated);
  try
    inherited;
  finally
    FStack.Pop;
  end;
end;

procedure TPasSyntaxTreeBuilder.DirectiveExperimental;
begin
  FStack.Push(ntExperimental);
  try
    inherited;
  finally
    FStack.Pop;
  end;
end;

procedure TPasSyntaxTreeBuilder.DirectiveLibrary;
begin
  FStack.Push(ntLibrary);
  try
    inherited;
  finally
    FStack.Pop;
  end;
end;

procedure TPasSyntaxTreeBuilder.DirectivePlatForm;
begin
  FStack.Push(ntPlatform);
  try
    inherited;
  finally
    FStack.Pop;
  end;
end;

procedure TmwSimplePasPar.DirectiveDeprecated;
begin
  ExpectedEx(ptDeprecated);
  if TokenID = ptStringConst then
    StringConst;
end;