Skip to content

Refactor value arrays to specialized types #19

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 6 commits into from
Nov 5, 2017
Merged

Conversation

thekid
Copy link
Member

@thekid thekid commented Nov 4, 2017

This makes code in emitters much more readable:

// Before
protected function emitConst($node) {
  $this->out->write('const '.$node->value[0].'=');
  $this->emit($node->value[1]);
  $this->out->write(';');
}

// Now
protected function emitConst($const) {
  $this->out->write('const '.$const->name.'=');
  $this->emit($const->expression);
  $this->out->write(';');
}

@thekid thekid changed the title Refactor vaue arrays to specialized types Refactor value arrays to specialized types Nov 4, 2017
@thekid
Copy link
Member Author

thekid commented Nov 4, 2017

The Kind subclasses should be named Value as it better describes what they are.

@thekid thekid merged commit 2031d0b into master Nov 5, 2017
@thekid thekid deleted the refactor/node-kind branch November 5, 2017 10:09
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