tweaking compiled tempvar names to satisfaction.

This commit is contained in:
Jeremy Ashkenas
2010-09-20 21:56:18 -04:00
parent 5d82dddfb1
commit f7fce3cd68
13 changed files with 472 additions and 465 deletions

View File

@@ -1,5 +1,5 @@
(function() {
var Parser, _cache, _cache2, _cache3, _cache4, _cache5, _index, _index2, _result, alt, alternatives, grammar, name, o, operators, token, tokens, unwrap;
var Parser, _i, _i2, _l, _l2, _ref, _ref2, _ref3, _result, alt, alternatives, grammar, name, o, operators, token, tokens, unwrap;
var __hasProp = Object.prototype.hasOwnProperty;
Parser = require('jison').Parser;
unwrap = /function\s*\(\)\s*\{\s*return\s*([\s\S]*);\s*\}/;
@@ -612,18 +612,18 @@
};
operators = [["right", '?', 'NEW'], ["left", 'CALL_START', 'CALL_END'], ["nonassoc", '++', '--'], ["right", 'UNARY'], ["left", 'MATH'], ["left", '+', '-'], ["left", 'SHIFT'], ["left", 'COMPARE'], ["left", 'INSTANCEOF'], ["left", '==', '!='], ["left", 'LOGIC'], ["right", 'COMPOUND_ASSIGN'], ["left", '.'], ["nonassoc", 'INDENT', 'OUTDENT'], ["right", 'WHEN', 'LEADING_WHEN', 'IN', 'OF', 'BY', 'THROW'], ["right", 'IF', 'UNLESS', 'ELSE', 'FOR', 'WHILE', 'UNTIL', 'LOOP', 'SUPER', 'CLASS', 'EXTENDS'], ["right", '=', ':', 'RETURN'], ["right", '->', '=>', 'UNLESS', 'POST_IF', 'POST_UNLESS']];
tokens = [];
_cache = grammar;
for (name in _cache) {
if (!__hasProp.call(_cache, name)) continue;
alternatives = _cache[name];
_ref = grammar;
for (name in _ref) {
if (!__hasProp.call(_ref, name)) continue;
alternatives = _ref[name];
grammar[name] = (function() {
_result = []; _cache2 = alternatives;
for (_index = 0, _cache3 = _cache2.length; _index < _cache3; _index++) {
alt = _cache2[_index];
_result = []; _ref2 = alternatives;
for (_i = 0, _l = _ref2.length; _i < _l; _i++) {
alt = _ref2[_i];
_result.push((function() {
_cache4 = alt[0].split(' ');
for (_index2 = 0, _cache5 = _cache4.length; _index2 < _cache5; _index2++) {
token = _cache4[_index2];
_ref3 = alt[0].split(' ');
for (_i2 = 0, _l2 = _ref3.length; _i2 < _l2; _i2++) {
token = _ref3[_i2];
if (!(grammar[token])) {
tokens.push(token);
}