This commit is contained in:
szabomarton committed 2025-01-28 11:38:27 +01:00
1 parent 9c5ca86086
commit 7f4a15b9c3
36841 files changed
+4032468 -1

No files matched your search

+4
View File
@@ -0,0 +1,4 @@
if (!yy.ast) {
yy.ast = _ast;
_ast.initialize();
}
+34
View File
@@ -0,0 +1,34 @@
var _ast = {
initialize: function() {
this._nodes = [];
this._node = {};
this._stash = [];
},
set: function(props) {
for (var k in props) this._node[k] = props[k];
return this._node;
},
node: function(obj) {
if (arguments.length) this._node = obj;
return this._node;
},
push: function() {
this._nodes.push(this._node);
this._node = {};
},
unshift: function() {
this._nodes.unshift(this._node);
this._node = {};
},
yield: function() {
var _nodes = this._nodes;
this.initialize();
return _nodes;
}
};