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

[feature] use identifier for class/interface/trait name #207

Closed
alexander-akait opened this issue Oct 22, 2018 · 3 comments · Fixed by #237
Closed

[feature] use identifier for class/interface/trait name #207

alexander-akait opened this issue Oct 22, 2018 · 3 comments · Fixed by #237

Comments

@alexander-akait
Copy link
Collaborator

alexander-akait commented Oct 22, 2018

As for function/method #196.

@ichiriac
Copy link
Member

ichiriac commented Oct 25, 2018

here the class name retrieval :

const propName = this.text();

To convert this string based name to a node :

    // allocate the identifier node creator (a function helper)
    let propName = this.node('identifier');
    // buffer the classname
    let className = this.text();
    // move to the next node (to identify the next location)
    this.next();
    // overwrite the node creator with the AST node instance (passing to it the string)
    propName = propName(className);
    // NOTE 1 : you may also change the ast/class.js documentation in order to change the name type 
    // NOTE 2 : one day I should also upgrade and maintain TS signatures
    let propExtends = null;
    let propImplements = null;
    if (this.token == this.tok.T_EXTENDS) { // <-- see here I no more use next, done before
      propExtends = this.next().read_namespace_name();
    }

@alexander-akait
Copy link
Collaborator Author

@ichiriac seems i understand code and i will starting fix problems, give me time 😄 I will ping you on PRs

@ichiriac
Copy link
Member

ichiriac commented Jan 7, 2019

released in 3.0.0-prerelease.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants