mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-04-11 03:00:13 -04:00
disabling traces in the jison parser fixes the performance problems -- ahh, much better
This commit is contained in:
@@ -436,8 +436,8 @@ parse: function parse(input) {
|
||||
var symbol, state, action, a, r, yyval={},p,len,ip=0,newState, expected;
|
||||
symbol = lex();
|
||||
while (true) {
|
||||
this.trace('stack:',JSON.stringify(stack), '\n\t\t\tinput:', this.lexer._input);
|
||||
this.trace('vstack:',JSON.stringify(vstack));
|
||||
// this.trace('stack:',JSON.stringify(stack), '\n\t\t\tinput:', this.lexer._input);
|
||||
// this.trace('vstack:',JSON.stringify(vstack));
|
||||
// set first input
|
||||
state = stack[stack.length-1];
|
||||
// read action for current state and first input
|
||||
@@ -454,7 +454,7 @@ parse: function parse(input) {
|
||||
{text: this.lexer.match, token: symbol, line: this.lexer.yylineno});
|
||||
}
|
||||
|
||||
this.trace('action:',action);
|
||||
// this.trace('action:',action);
|
||||
|
||||
// this shouldn't happen, unless resolve defaults are off
|
||||
if (action.length > 1) {
|
||||
@@ -481,7 +481,7 @@ parse: function parse(input) {
|
||||
reductions++;
|
||||
|
||||
len = this.productions_[a[1]][1];
|
||||
this.trace('reduce by: ', this.productions ? this.productions[a[1]] : a[1]);
|
||||
// this.trace('reduce by: ', this.productions ? this.productions[a[1]] : a[1]);
|
||||
|
||||
// perform semantic action
|
||||
yyval.$ = vstack[vstack.length-len]; // default to $$ = $1
|
||||
@@ -491,11 +491,11 @@ parse: function parse(input) {
|
||||
return r;
|
||||
}
|
||||
|
||||
this.trace('yyval=',JSON.stringify(yyval.$));
|
||||
// this.trace('yyval=',JSON.stringify(yyval.$));
|
||||
|
||||
// pop off stack
|
||||
if (len) {
|
||||
this.trace('production length:',len);
|
||||
// this.trace('production length:',len);
|
||||
stack = stack.slice(0,-1*len*2);
|
||||
vstack = vstack.slice(0, -1*len);
|
||||
}
|
||||
@@ -509,10 +509,10 @@ parse: function parse(input) {
|
||||
|
||||
case 3: // accept
|
||||
|
||||
this.trace('stack:',stack, '\n\tinput:', this.lexer._input);
|
||||
this.trace('vstack:',JSON.stringify(vstack));
|
||||
this.trace('Total reductions:', reductions);
|
||||
this.trace('Total shifts:', shifts);
|
||||
// this.trace('stack:',stack, '\n\tinput:', this.lexer._input);
|
||||
// this.trace('vstack:',JSON.stringify(vstack));
|
||||
// this.trace('Total reductions:', reductions);
|
||||
// this.trace('Total shifts:', shifts);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user