implementing grayrest's suggested cleanup for object comprehensions

This commit is contained in:
Jeremy Ashkenas
2010-02-14 17:35:14 -05:00
parent e110042275
commit 7667e16732
6 changed files with 44 additions and 74 deletions

View File

@@ -522,26 +522,24 @@
bnf = {};
tokens = [];
__a = grammar;
for (name in __a) {
for (name in __a) if (__hasProp.call(__a, name)) {
non_terminal = __a[name];
if (__hasProp.call(__a, name)) {
bnf[name] = (function() {
__b = []; __c = non_terminal;
for (__d = 0; __d < __c.length; __d++) {
option = __c[__d];
__b.push((function() {
__e = option[0].split(" ");
for (__f = 0; __f < __e.length; __f++) {
part = __e[__f];
!grammar[part] ? tokens.push(part) : null;
}
name === "Root" ? (option[1] = "return " + option[1]) : null;
return option;
}).call(this));
}
return __b;
}).call(this);
}
bnf[name] = (function() {
__b = []; __c = non_terminal;
for (__d = 0; __d < __c.length; __d++) {
option = __c[__d];
__b.push((function() {
__e = option[0].split(" ");
for (__f = 0; __f < __e.length; __f++) {
part = __e[__f];
!grammar[part] ? tokens.push(part) : null;
}
name === "Root" ? (option[1] = "return " + option[1]) : null;
return option;
}).call(this));
}
return __b;
}).call(this);
}
tokens = tokens.join(" ");
parser = new Parser({