Skip to content
This repository was archived by the owner on Sep 9, 2019. It is now read-only.

Conversation

@thekid
Copy link
Contributor

@thekid thekid commented Sep 19, 2015

This pull request adds the yield expression to XP language and PHP syntax.

class Test {
  private static var values() {
    yield 1;
    yield 2;
  }

  private static var mappings() {
    yield 'number' : 1;
    yield 'color' : 'green';
  }

  // ...
}

To support it by default, the PHP 5.5 emitter becomes the default. To downgrade to emit PHP 5.4 code, use -E php5.4.

Note: This will currently raise an error since PHP 5.4 doesn't support generators, and we cannot simulate them side-effect freely without language support!

@thekid thekid added the feature label Sep 19, 2015
thekid added a commit that referenced this pull request Sep 19, 2015
@thekid thekid merged commit d987e09 into master Sep 19, 2015
@thekid thekid deleted the feature/yield branch September 19, 2015 13:57
@thekid thekid added the php label Sep 20, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants