Skip to content

Commit 0552a20

Browse files
committed
release dist
1 parent 5ef26e8 commit 0552a20

File tree

3 files changed

+142
-83
lines changed

3 files changed

+142
-83
lines changed

dist/php-parser.js

+92-33
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ var Position = require('./ast/position');
212212
* - [Variable](#variable)
213213
* - [Variadic](#variadic)
214214
* - [ConstRef](#constref)
215+
* - [Yield](#yield)
216+
* - [YieldFrom](#yieldfrom)
215217
* - [Lookup](#lookup)
216218
* - [PropertyLookup](#propertylookup)
217219
* - [StaticLookup](#staticlookup)
@@ -444,7 +446,9 @@ AST.prototype.prepare = function(kind, parser) {
444446
require('./ast/useitem'),
445447
require('./ast/variable'),
446448
require('./ast/variadic'),
447-
require('./ast/while')
449+
require('./ast/while'),
450+
require('./ast/yield'),
451+
require('./ast/yieldfrom')
448452
].forEach(function (ctor) {
449453
var kind = ctor.prototype.constructor.name.toLowerCase();
450454
if (kind[0] === '_') kind = kind.substring(1);
@@ -453,7 +457,7 @@ AST.prototype.prepare = function(kind, parser) {
453457

454458
module.exports = AST;
455459

456-
},{"./ast/array":3,"./ast/assign":4,"./ast/bin":5,"./ast/block":6,"./ast/bool":7,"./ast/boolean":8,"./ast/break":9,"./ast/call":10,"./ast/case":11,"./ast/cast":12,"./ast/catch":13,"./ast/class":14,"./ast/classconstant":15,"./ast/clone":16,"./ast/closure":17,"./ast/coalesce":18,"./ast/constant":19,"./ast/constref":20,"./ast/continue":21,"./ast/declare":23,"./ast/do":24,"./ast/doc":25,"./ast/echo":26,"./ast/empty":27,"./ast/encapsed":28,"./ast/entry":29,"./ast/error":30,"./ast/eval":31,"./ast/exit":32,"./ast/expression":33,"./ast/for":34,"./ast/foreach":35,"./ast/function":36,"./ast/global":37,"./ast/goto":38,"./ast/halt":39,"./ast/identifier":40,"./ast/if":41,"./ast/include":42,"./ast/inline":43,"./ast/interface":44,"./ast/isset":45,"./ast/label":46,"./ast/list":47,"./ast/literal":48,"./ast/location":49,"./ast/magic":51,"./ast/method":52,"./ast/namespace":53,"./ast/new":54,"./ast/node":55,"./ast/nowdoc":56,"./ast/number":57,"./ast/offsetlookup":58,"./ast/parameter":60,"./ast/parenthesis":61,"./ast/position":62,"./ast/post":63,"./ast/pre":64,"./ast/print":65,"./ast/program":66,"./ast/property":67,"./ast/propertylookup":68,"./ast/retif":69,"./ast/return":70,"./ast/shell":71,"./ast/silent":72,"./ast/static":74,"./ast/staticlookup":75,"./ast/string":76,"./ast/switch":77,"./ast/throw":79,"./ast/trait":80,"./ast/traitalias":81,"./ast/traitprecedence":82,"./ast/traituse":83,"./ast/try":84,"./ast/unary":85,"./ast/unset":86,"./ast/usegroup":87,"./ast/useitem":88,"./ast/variable":89,"./ast/variadic":90,"./ast/while":91}],3:[function(require,module,exports){
460+
},{"./ast/array":3,"./ast/assign":4,"./ast/bin":5,"./ast/block":6,"./ast/bool":7,"./ast/boolean":8,"./ast/break":9,"./ast/call":10,"./ast/case":11,"./ast/cast":12,"./ast/catch":13,"./ast/class":14,"./ast/classconstant":15,"./ast/clone":16,"./ast/closure":17,"./ast/coalesce":18,"./ast/constant":19,"./ast/constref":20,"./ast/continue":21,"./ast/declare":23,"./ast/do":24,"./ast/doc":25,"./ast/echo":26,"./ast/empty":27,"./ast/encapsed":28,"./ast/entry":29,"./ast/error":30,"./ast/eval":31,"./ast/exit":32,"./ast/expression":33,"./ast/for":34,"./ast/foreach":35,"./ast/function":36,"./ast/global":37,"./ast/goto":38,"./ast/halt":39,"./ast/identifier":40,"./ast/if":41,"./ast/include":42,"./ast/inline":43,"./ast/interface":44,"./ast/isset":45,"./ast/label":46,"./ast/list":47,"./ast/literal":48,"./ast/location":49,"./ast/magic":51,"./ast/method":52,"./ast/namespace":53,"./ast/new":54,"./ast/node":55,"./ast/nowdoc":56,"./ast/number":57,"./ast/offsetlookup":58,"./ast/parameter":60,"./ast/parenthesis":61,"./ast/position":62,"./ast/post":63,"./ast/pre":64,"./ast/print":65,"./ast/program":66,"./ast/property":67,"./ast/propertylookup":68,"./ast/retif":69,"./ast/return":70,"./ast/shell":71,"./ast/silent":72,"./ast/static":74,"./ast/staticlookup":75,"./ast/string":76,"./ast/switch":77,"./ast/throw":79,"./ast/trait":80,"./ast/traitalias":81,"./ast/traitprecedence":82,"./ast/traituse":83,"./ast/try":84,"./ast/unary":85,"./ast/unset":86,"./ast/usegroup":87,"./ast/useitem":88,"./ast/variable":89,"./ast/variadic":90,"./ast/while":91,"./ast/yield":92,"./ast/yieldfrom":93}],3:[function(require,module,exports){
457461
/*!
458462
* Copyright (C) 2017 Glayzzle (BSD3 License)
459463
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
@@ -2879,6 +2883,58 @@ module.exports = While;
28792883
* @url http://glayzzle.com
28802884
*/
28812885
"use strict";
2886+
2887+
var Expression = require('./expression');
2888+
var KIND = 'yield';
2889+
2890+
/**
2891+
* Defines a yield generator statement
2892+
* @constructor Yield
2893+
* @extends {Expression}
2894+
* @property {Expression|Null} value
2895+
* @property {Expression|Null} key
2896+
* @see http://php.net/manual/en/language.generators.syntax.php
2897+
*/
2898+
var Yield = Expression.extends(function Yield(value, key, location) {
2899+
Expression.apply(this, [KIND, location]);
2900+
this.value = value;
2901+
this.key = key;
2902+
});
2903+
2904+
module.exports = Yield;
2905+
2906+
},{"./expression":33}],93:[function(require,module,exports){
2907+
/*!
2908+
* Copyright (C) 2017 Glayzzle (BSD3 License)
2909+
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
2910+
* @url http://glayzzle.com
2911+
*/
2912+
"use strict";
2913+
2914+
var Expression = require('./expression');
2915+
var KIND = 'yieldfrom';
2916+
2917+
/**
2918+
* Defines a yield from generator statement
2919+
* @constructor YieldFrom
2920+
* @extends {Expression}
2921+
* @property {Expression} value
2922+
* @see http://php.net/manual/en/language.generators.syntax.php
2923+
*/
2924+
var YieldFrom = Expression.extends(function YieldFrom(value, location) {
2925+
Expression.apply(this, [KIND, location]);
2926+
this.value = value;
2927+
});
2928+
2929+
module.exports = YieldFrom;
2930+
2931+
},{"./expression":33}],94:[function(require,module,exports){
2932+
/*!
2933+
* Copyright (C) 2017 Glayzzle (BSD3 License)
2934+
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
2935+
* @url http://glayzzle.com
2936+
*/
2937+
"use strict";
28822938
/**
28832939
* This is the php lexer. It will tokenize the string for helping the
28842940
* parser to build the AST from its grammar.
@@ -3312,7 +3368,7 @@ lexer.prototype.next = function () {
33123368

33133369
module.exports = lexer;
33143370

3315-
},{"./lexer/comments.js":93,"./lexer/initial.js":94,"./lexer/numbers.js":95,"./lexer/property.js":96,"./lexer/scripting.js":97,"./lexer/strings.js":98,"./lexer/tokens.js":99,"./lexer/utils.js":100}],93:[function(require,module,exports){
3371+
},{"./lexer/comments.js":95,"./lexer/initial.js":96,"./lexer/numbers.js":97,"./lexer/property.js":98,"./lexer/scripting.js":99,"./lexer/strings.js":100,"./lexer/tokens.js":101,"./lexer/utils.js":102}],95:[function(require,module,exports){
33163372
/*!
33173373
* Copyright (C) 2017 Glayzzle (BSD3 License)
33183374
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
@@ -3369,7 +3425,7 @@ module.exports = {
33693425
}
33703426
};
33713427

3372-
},{}],94:[function(require,module,exports){
3428+
},{}],96:[function(require,module,exports){
33733429
/*!
33743430
* Copyright (C) 2017 Glayzzle (BSD3 License)
33753431
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
@@ -3429,7 +3485,7 @@ module.exports = {
34293485
}
34303486
};
34313487

3432-
},{}],95:[function(require,module,exports){
3488+
},{}],97:[function(require,module,exports){
34333489
(function (process){
34343490
/*!
34353491
* Copyright (C) 2017 Glayzzle (BSD3 License)
@@ -3558,7 +3614,7 @@ module.exports = {
35583614
};
35593615

35603616
}).call(this,require('_process'))
3561-
},{"_process":1}],96:[function(require,module,exports){
3617+
},{"_process":1}],98:[function(require,module,exports){
35623618
/*!
35633619
* Copyright (C) 2017 Glayzzle (BSD3 License)
35643620
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
@@ -3632,7 +3688,7 @@ module.exports = {
36323688
}
36333689
};
36343690

3635-
},{}],97:[function(require,module,exports){
3691+
},{}],99:[function(require,module,exports){
36363692
/*!
36373693
* Copyright (C) 2017 Glayzzle (BSD3 License)
36383694
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
@@ -3734,7 +3790,7 @@ module.exports = {
37343790
}
37353791
};
37363792

3737-
},{}],98:[function(require,module,exports){
3793+
},{}],100:[function(require,module,exports){
37383794
/*!
37393795
* Copyright (C) 2017 Glayzzle (BSD3 License)
37403796
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
@@ -4150,7 +4206,7 @@ module.exports = {
41504206
}
41514207
};
41524208

4153-
},{}],99:[function(require,module,exports){
4209+
},{}],101:[function(require,module,exports){
41544210
/*!
41554211
* Copyright (C) 2017 Glayzzle (BSD3 License)
41564212
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
@@ -4421,7 +4477,7 @@ module.exports = {
44214477
}
44224478
};
44234479

4424-
},{}],100:[function(require,module,exports){
4480+
},{}],102:[function(require,module,exports){
44254481
/*!
44264482
* Copyright (C) 2017 Glayzzle (BSD3 License)
44274483
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
@@ -4509,7 +4565,7 @@ module.exports = {
45094565
}
45104566
};
45114567

4512-
},{}],101:[function(require,module,exports){
4568+
},{}],103:[function(require,module,exports){
45134569
/*!
45144570
* Copyright (C) 2017 Glayzzle (BSD3 License)
45154571
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
@@ -4913,7 +4969,7 @@ parser.prototype.read_token = function() {
49134969

49144970
module.exports = parser;
49154971

4916-
},{"./parser/array.js":102,"./parser/class.js":103,"./parser/comment.js":104,"./parser/expr.js":105,"./parser/function.js":106,"./parser/if.js":107,"./parser/loops.js":108,"./parser/main.js":109,"./parser/namespace.js":110,"./parser/scalar.js":111,"./parser/statement.js":112,"./parser/switch.js":113,"./parser/try.js":114,"./parser/utils.js":115,"./parser/variable.js":116}],102:[function(require,module,exports){
4972+
},{"./parser/array.js":104,"./parser/class.js":105,"./parser/comment.js":106,"./parser/expr.js":107,"./parser/function.js":108,"./parser/if.js":109,"./parser/loops.js":110,"./parser/main.js":111,"./parser/namespace.js":112,"./parser/scalar.js":113,"./parser/statement.js":114,"./parser/switch.js":115,"./parser/try.js":116,"./parser/utils.js":117,"./parser/variable.js":118}],104:[function(require,module,exports){
49174973
/*!
49184974
* Copyright (C) 2017 Glayzzle (BSD3 License)
49194975
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
@@ -5004,7 +5060,7 @@ module.exports = {
50045060
}
50055061
};
50065062

5007-
},{}],103:[function(require,module,exports){
5063+
},{}],105:[function(require,module,exports){
50085064
/*!
50095065
* Copyright (C) 2017 Glayzzle (BSD3 License)
50105066
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
@@ -5449,7 +5505,7 @@ module.exports = {
54495505
}
54505506
};
54515507

5452-
},{}],104:[function(require,module,exports){
5508+
},{}],106:[function(require,module,exports){
54535509
/*!
54545510
* Copyright (C) 2017 Glayzzle (BSD3 License)
54555511
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
@@ -5496,7 +5552,7 @@ module.exports = {
54965552
}
54975553
};
54985554

5499-
},{}],105:[function(require,module,exports){
5555+
},{}],107:[function(require,module,exports){
55005556
/*!
55015557
* Copyright (C) 2017 Glayzzle (BSD3 License)
55025558
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
@@ -5814,20 +5870,23 @@ module.exports = {
58145870

58155871
// T_YIELD (expr (T_DOUBLE_ARROW expr)?)?
58165872
case this.tok.T_YIELD:
5817-
var result = ['yield', null, null];
5873+
var result = this.node('yield'), value = null, key = null;
58185874
if (this.next().is('EXPR')) {
58195875
// reads the yield return value
5820-
result[1] = this.read_expr();
5876+
value = this.read_expr();
58215877
if (this.token === this.tok.T_DOUBLE_ARROW) {
58225878
// reads the yield returned key
5823-
result[2] = this.next().read_expr();
5879+
key = value;
5880+
value = this.next().read_expr();
58245881
}
58255882
}
5826-
return result;
5883+
return result(value, key);
58275884

58285885
// T_YIELD_FROM expr
58295886
case this.tok.T_YIELD_FROM:
5830-
return ['yieldfrom', this.next().read_expr()];
5887+
var result = this.node('yieldfrom');
5888+
var expr = this.next().read_expr();
5889+
return result(expr);
58315890

58325891
case this.tok.T_FUNCTION:
58335892
// @fixme later - removed static lambda function declarations (colides with static keyword usage)
@@ -6012,7 +6071,7 @@ module.exports = {
60126071
}
60136072
};
60146073

6015-
},{}],106:[function(require,module,exports){
6074+
},{}],108:[function(require,module,exports){
60166075
/*!
60176076
* Copyright (C) 2017 Glayzzle (BSD3 License)
60186077
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
@@ -6248,7 +6307,7 @@ module.exports = {
62486307
}
62496308
};
62506309

6251-
},{}],107:[function(require,module,exports){
6310+
},{}],109:[function(require,module,exports){
62526311
/*!
62536312
* Copyright (C) 2017 Glayzzle (BSD3 License)
62546313
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
@@ -6348,7 +6407,7 @@ module.exports = {
63486407
}
63496408
};
63506409

6351-
},{}],108:[function(require,module,exports){
6410+
},{}],110:[function(require,module,exports){
63526411
/*!
63536412
* Copyright (C) 2017 Glayzzle (BSD3 License)
63546413
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
@@ -6508,7 +6567,7 @@ module.exports = {
65086567
}
65096568
};
65106569

6511-
},{}],109:[function(require,module,exports){
6570+
},{}],111:[function(require,module,exports){
65126571
/*!
65136572
* Copyright (C) 2017 Glayzzle (BSD3 License)
65146573
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
@@ -6530,7 +6589,7 @@ module.exports = {
65306589
}
65316590
};
65326591

6533-
},{}],110:[function(require,module,exports){
6592+
},{}],112:[function(require,module,exports){
65346593
/*!
65356594
* Copyright (C) 2017 Glayzzle (BSD3 License)
65366595
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
@@ -6700,7 +6759,7 @@ module.exports = {
67006759
}
67016760
};
67026761

6703-
},{}],111:[function(require,module,exports){
6762+
},{}],113:[function(require,module,exports){
67046763
/*!
67056764
* Copyright (C) 2017 Glayzzle (BSD3 License)
67066765
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
@@ -6995,7 +7054,7 @@ module.exports = {
69957054
}
69967055
};
69977056

6998-
},{}],112:[function(require,module,exports){
7057+
},{}],114:[function(require,module,exports){
69997058
/*!
70007059
* Copyright (C) 2017 Glayzzle (BSD3 License)
70017060
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
@@ -7359,7 +7418,7 @@ module.exports = {
73597418
}
73607419
};
73617420

7362-
},{}],113:[function(require,module,exports){
7421+
},{}],115:[function(require,module,exports){
73637422
/*!
73647423
* Copyright (C) 2017 Glayzzle (BSD3 License)
73657424
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
@@ -7455,7 +7514,7 @@ module.exports = {
74557514
}
74567515
};
74577516

7458-
},{}],114:[function(require,module,exports){
7517+
},{}],116:[function(require,module,exports){
74597518
/*!
74607519
* Copyright (C) 2017 Glayzzle (BSD3 License)
74617520
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
@@ -7501,7 +7560,7 @@ module.exports = {
75017560
}
75027561
};
75037562

7504-
},{}],115:[function(require,module,exports){
7563+
},{}],117:[function(require,module,exports){
75057564
/*!
75067565
* Defines a list of helper functions for parsing
75077566
* Copyright (C) 2017 Glayzzle (BSD3 License)
@@ -7623,7 +7682,7 @@ module.exports = {
76237682

76247683
};
76257684

7626-
},{}],116:[function(require,module,exports){
7685+
},{}],118:[function(require,module,exports){
76277686
/*!
76287687
* Copyright (C) 2017 Glayzzle (BSD3 License)
76297688
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
@@ -7918,7 +7977,7 @@ module.exports = {
79187977
}
79197978
};
79207979

7921-
},{}],117:[function(require,module,exports){
7980+
},{}],119:[function(require,module,exports){
79227981
/*!
79237982
* Copyright (C) 2017 Glayzzle (BSD3 License)
79247983
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
@@ -8388,4 +8447,4 @@ engine.prototype.tokenGetAll = function(buffer) {
83888447
// exports the function
83898448
module.exports = engine;
83908449

8391-
},{"./ast":2,"./lexer":92,"./parser":101,"./tokens":117}]},{},[]);
8450+
},{"./ast":2,"./lexer":94,"./parser":103,"./tokens":119}]},{},[]);

0 commit comments

Comments
 (0)