Skip to content

Commit

Permalink
parser notes
Browse files Browse the repository at this point in the history
  • Loading branch information
maxtaco committed Jul 15, 2011
1 parent 9169a27 commit 5c10c53
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
15 changes: 15 additions & 0 deletions lib/runtime.js
Expand Up @@ -61,6 +61,21 @@ function Rendezvous () {
return (function () { copy (arguments, dest); x.trigger (id); });
};

this.mkevent = function (id, assign_fn) {
this._count++;
var x = this;
return (function () {
if (assign_fn) {
assign_fn (arguments);
}
x.trigger ();
});
};

// This is a little hack to allow generated mkevent's work in
// both this case and the normal twait case.
this.__tame_ev = this;

this.wait = function (ev) {
if (this._completed.length) {
var x = this._completed.shift ();
Expand Down
5 changes: 5 additions & 0 deletions notes/parsing.txt
Expand Up @@ -4,3 +4,8 @@

- List of parsers here:
https://github.com/joyent/node/wiki/modules#parser-generators

- Try perhaps uglify / burrito:
- https://github.com/mishoo/UglifyJS
- https://github.com/mishoo/UglifyJS/blob/6a873a7757895fdc06501854e4ba84e15c12a74a/tmp/instrument.js
- https://github.com/substack/node-burrito
8 changes: 8 additions & 0 deletions test/cases/17.tjs
Expand Up @@ -30,6 +30,14 @@ exports["a test of trigger values"] = {
}


rv = new tame.Rendezvous ();
for (var i = 0; i < 20; i++) {
var x = 3 * Math.random ();
var res = [];
foo (x, rv.mkevent (res)); }
if (x != res[0]) { ok = false; }
}

cb ();

},
Expand Down
2 changes: 1 addition & 1 deletion test/cases/18.tjs
Expand Up @@ -4,7 +4,7 @@ var slots = {};
var n = 40;
var assert = require ("assert");

exports["simple parallel twait"] = {
exports["test do..while..."] = {

run : function (cb) {
var i = 0;
Expand Down

0 comments on commit 5c10c53

Please sign in to comment.