Skip to content

Extract AST to its own library #22

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

Merged
merged 16 commits into from
Nov 6, 2017
Merged

Extract AST to its own library #22

merged 16 commits into from
Nov 6, 2017

Conversation

thekid
Copy link
Member

@thekid thekid commented Nov 5, 2017

This pull request extracts Node and Value classes into https://github.com/xp-framework/ast as a prerequisite for xp-framework/rfc#327

API changes

The API has been changed to be more concise in naming and more consistent and intuitive in parameter order.

Types:

  • ClassValue is now ClassDeclaration
  • InterfaceValue is now InterfaceDeclaration
  • TraitValue is now TraitDeclaration
new ClassDeclaration($modifiers, $name, $parent, $interfaces, $body[, $annotations[, $comment]])
new InterfaceDeclaration($modifiers, $name, $parents, $body[, $annotations[, $comment]])
new TraitDeclaration($modifiers, $name,  $body[, $annotations[, $comment]])

Type members:

  • MethodValue is now Method
  • PropertyValue is now Property
  • ConstValue is now Constant
new Method($modifiers, $name, $signature[, $body[, $annotations[, $comment]]])
new Property($modifiers, $name, $type[, $expression[, $annotations[, $comment]]])
new Constant($modifiers, $name, $expression)

Related:

new Signature([$parameters[, $return]]) 
new Parameter($name, $type[, $default[, $reference[, $variadic[, $promote[, $annotations]]]]])

Others

All other node values are now named ...Statement or ...Expression

@thekid thekid merged commit 6a88aaa into master Nov 6, 2017
@thekid thekid deleted the refactor/extract-ast branch November 6, 2017 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant