Skip to content

Commit

Permalink
Fix bug in pegen.js, dramatically improves parsing speed. Related to …
Browse files Browse the repository at this point in the history
…issue #2354.
  • Loading branch information
PierreQuentel committed Jan 19, 2024
1 parent 134561f commit ef00679
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions www/src/pegen.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,6 @@ $B._PyPegen.get_memo_statistics = function(){
return ret;
}
// #endif

$B._PyPegen.is_memoized = function(p, type, pres){
if (p.mark == p.fill) {
if ($B._PyPegen.fill_token(p) < 0) {
Expand Down Expand Up @@ -540,15 +539,14 @@ $B._PyPegen.get_last_nonnwhitespace_token = function(p){
var token = NULL;
for (let m = p.mark - 1; m >= 0; m--) {
token = p.tokens[m];
if (token.type != ENDMARKER && (token.type < NEWLINE || token.type > DEDENT)) {
if (token.num_type != ENDMARKER && (token.num_type < NEWLINE || token.num_type > DEDENT)) {
break;
}
}
return token;
}

$B._PyPegen.new_identifier = function(p, n){
console.log('new ident', p, n)
var id = n
/* PyUnicode_DecodeUTF8 should always return a ready string. */
// assert(PyUnicode_IS_READY(id));
Expand Down

0 comments on commit ef00679

Please sign in to comment.