Skip to content

Commit

Permalink
[JS] Fix TypeError in LR parser code parsing error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
lierdakil committed Jun 6, 2020
1 parent f7746f7 commit 9b01069
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Parser/LR/JS.hs
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ module.exports = {#{name}}
}|] :: Maybe Text
actionBody Reject = [interp|
const lastSt = this._top()
const parsed = stateToString(lastSt)
const parsed = [stateToString(lastSt)]
while (this.stack.length > 0) {
this.stack.pop()
parsed = stateToString(this._top()) + " " + parsed
parsed.unshift(stateToString(this._top()))
}
throw new Error(
`Rejection state reached after parsing "${parsed}", when encoutered symbol "${tokToStr(a[0])}" in state ${lastSt}. Expected "${expectedSym(lastSt)}"`)
`Rejection state reached after parsing "${parsed.join(' ')}", when encoutered symbol "${tokToStr(a[0])}" in state ${lastSt}. Expected "${expectedSym(lastSt)}"`)
|] :: Text
actionBody (Shift _) = error "does not happen"
actionBody (Reduce ((ExtendedStartRule, _), _)) = [interp|
Expand Down

0 comments on commit 9b01069

Please sign in to comment.