Skip to content

Commit 79fc7e1

Browse files
committed
new nodes
1 parent 0552a20 commit 79fc7e1

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

src/ast/yield.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*!
2+
* Copyright (C) 2017 Glayzzle (BSD3 License)
3+
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
4+
* @url http://glayzzle.com
5+
*/
6+
"use strict";
7+
8+
var Expression = require('./expression');
9+
var KIND = 'yield';
10+
11+
/**
12+
* Defines a yield generator statement
13+
* @constructor Yield
14+
* @extends {Expression}
15+
* @property {Expression|Null} value
16+
* @property {Expression|Null} key
17+
* @see http://php.net/manual/en/language.generators.syntax.php
18+
*/
19+
var Yield = Expression.extends(function Yield(value, key, location) {
20+
Expression.apply(this, [KIND, location]);
21+
this.value = value;
22+
this.key = key;
23+
});
24+
25+
module.exports = Yield;

src/ast/yieldfrom.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*!
2+
* Copyright (C) 2017 Glayzzle (BSD3 License)
3+
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
4+
* @url http://glayzzle.com
5+
*/
6+
"use strict";
7+
8+
var Expression = require('./expression');
9+
var KIND = 'yieldfrom';
10+
11+
/**
12+
* Defines a yield from generator statement
13+
* @constructor YieldFrom
14+
* @extends {Expression}
15+
* @property {Expression} value
16+
* @see http://php.net/manual/en/language.generators.syntax.php
17+
*/
18+
var YieldFrom = Expression.extends(function YieldFrom(value, location) {
19+
Expression.apply(this, [KIND, location]);
20+
this.value = value;
21+
});
22+
23+
module.exports = YieldFrom;

0 commit comments

Comments
 (0)