nl_tokens: We need a peek function . If it has an argument it peeks that much farther ahead . It is used to distinguish for ( var i in ... from for ( var i = ...
pl_tokens: function peek ( p ) { var i = p || 0 , j = 0 , t ; while ( j <= i ) { t = lookahead [ j ] ; if ( ! t ) { t = lookahead [ j ] = lex . token ( ) ; } j += 1 ; } // Peeking past the end of the program should produce the "(end)" token. if ( ! t && state . tokens . <mask> . id === "(end)" ) { return state . tokens . next ; } return t ; }