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

static methodbinding is not recorded. #248

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

static methodbinding is not recorded. #248

JBontes opened this issue Oct 13, 2017 · 0 comments

Comments

@JBontes
Copy link

JBontes commented Oct 13, 2017

type
  r = record
    class procedure T; static;
  end;

The static method binding is not recorded.

Here's the fix:

procedure TPasSyntaxTreeBuilder.DirectiveBinding;
var
  Token: string;
begin
  token := Lexer.Token;
  // Method bindings:
  if SameText(Token, 'override') or SameText(token, 'virtual')
    or SameText(Token, 'dynamic') or SameText(Token, 'static')
  then
    FStack.Peek.Attribute[anMethodBinding]:= Token
  // Other directives
  else if SameText(token, 'reintroduce') then
    FStack.Peek.Attribute[anReintroduce]:= AttributeValues[atTrue]
  else if SameText(Token, 'overload') then
    FStack.Peek.Attribute[anOverload]:=  AttributeValues[atTrue]
  else if SameText(Token, 'abstract') or SameText(Token, 'final') then
    FStack.Peek.Attribute[anAbstract]:= Token;
  inherited;
end;
JBontes pushed a commit to JBontes/DelphiAST that referenced this issue Oct 13, 2017
JBontes pushed a commit to JBontes/DelphiAST that referenced this issue Oct 14, 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