Comparing version 0.4.0 to 0.4.1
@@ -0,1 +1,7 @@ | ||
## 0.4.1 (2019-10-14) | ||
### Bug fixes | ||
Fix an infinite loop where error recovery keeps finding zero-length tokens and imagining it's making progress. | ||
## 0.4.0 (2019-09-10) | ||
@@ -2,0 +8,0 @@ |
@@ -239,2 +239,4 @@ 'use strict'; | ||
var start = this.pos, nextState = action, parser = this.cx.parser; | ||
if (nextEnd > this.pos) | ||
this.badness = (this.badness >> 1) + (this.badness >> 2); // (* 0.75) | ||
if (nextEnd > this.pos || next <= parser.maxNode) { | ||
@@ -248,5 +250,4 @@ this.pos = nextEnd; | ||
this.buffer.push(next, start, nextEnd, 4); | ||
this.badness = (this.badness >> 1) + (this.badness >> 2); // (* 0.75) | ||
} | ||
else { // Shift-and-stay, which means this is skipped token | ||
else { // Shift-and-stay, which means this is a skipped token | ||
if (next <= this.cx.parser.maxNode) | ||
@@ -253,0 +254,0 @@ this.buffer.push(next, this.pos, nextEnd, 4); |
{ | ||
"name": "lezer", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "Incremental parser", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -199,2 +199,4 @@ import {Action, Term, StateFlag, ParseState} from "./constants" | ||
let start = this.pos, nextState = action, {parser} = this.cx | ||
if (nextEnd > this.pos) | ||
this.badness = (this.badness >> 1) + (this.badness >> 2) // (* 0.75) | ||
if (nextEnd > this.pos || next <= parser.maxNode) { | ||
@@ -206,4 +208,3 @@ this.pos = nextEnd | ||
if (next <= parser.maxNode) this.buffer.push(next, start, nextEnd, 4) | ||
this.badness = (this.badness >> 1) + (this.badness >> 2) // (* 0.75) | ||
} else { // Shift-and-stay, which means this is skipped token | ||
} else { // Shift-and-stay, which means this is a skipped token | ||
if (next <= this.cx.parser.maxNode) this.buffer.push(next, this.pos, nextEnd, 4) | ||
@@ -210,0 +211,0 @@ this.pos = nextEnd |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1974688
3009