RomanYankovsky / DelphiAST

Abstract syntax tree builder for Delphi
Mozilla Public License 2.0
272 stars 117 forks source link

NilToken should be a `TValuedSyntaxNode` #239

Open JBontes opened 7 years ago

JBontes commented 7 years ago

All Literals are ValuedSyntaxNodes. If we make some literals a different type, things get really confusing.

Fix:

procedure TPasSyntaxTreeBuilder.NilToken;
var
  Node: TSyntaxNode;
begin
  Node:= FStack.AddValuedChild(ntLiteral, AttributeValues[atNil]);
  Node.Attribute[anType]:= AttributeValues[atNil];
  inherited;
end;