Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

absolute directive is not recorded #253

Open
JBontes opened this issue Oct 17, 2017 · 0 comments
Open

absolute directive is not recorded #253

JBontes opened this issue Oct 17, 2017 · 0 comments

Comments

@JBontes
Copy link

JBontes commented Oct 17, 2017

var 
  x: integer;
  y: integer absolute x;

The absolute is not recorded. and the x is recorded as if it was a value assigned to the variable.

The fix:

procedure TPasSyntaxTreeBuilder.VarAbsolute;
var
  AbsoluteNode: TSyntaxNode;
  ValueNode: TSyntaxNode;
begin
  AbsoluteNode:= TSyntaxNode.Create(ntUnknown);
  FStack.Push(AbsoluteNode);
  try
    inherited;
  finally
    FStack.Pop;
    ValueNode:= AbsoluteNode.ExtractChild(AbsoluteNode.ChildNode[0]);
    ValueNode.Attribute[anKind]:= AttributeValues[atAbsolute];
    AbsoluteNode.Free;
    FStack.Peek.AddChild(ValueNode);
  end;
end;
JBontes pushed a commit to JBontes/DelphiAST that referenced this issue Oct 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant