Skip to content

Commit

Permalink
Fix incorrect comment in regexp parser
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed Mar 1, 2020
1 parent 12ae8fe commit b5c1787
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions acorn/src/regexp.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ pp.regexp_pattern = function(state) {
if (state.eat(0x29 /* ) */)) {
state.raise("Unmatched ')'")
}
if (state.eat(0x5D /* [ */) || state.eat(0x7D /* } */)) {
if (state.eat(0x5D /* ] */) || state.eat(0x7D /* } */)) {
state.raise("Lone quantifier brackets")
}
}
Expand Down Expand Up @@ -837,7 +837,7 @@ pp.regexp_eatCharacterClass = function(state) {
if (state.eat(0x5B /* [ */)) {
state.eat(0x5E /* ^ */)
this.regexp_classRanges(state)
if (state.eat(0x5D /* [ */)) {
if (state.eat(0x5D /* ] */)) {
return true
}
// Unreachable since it threw "unterminated regular expression" error before.
Expand Down Expand Up @@ -885,7 +885,7 @@ pp.regexp_eatClassAtom = function(state) {
}

const ch = state.current()
if (ch !== 0x5D /* [ */) {
if (ch !== 0x5D /* ] */) {
state.lastIntValue = ch
state.advance()
return true
Expand Down

0 comments on commit b5c1787

Please sign in to comment.