Skip to content

Commit b5c1787

Browse files
committedMar 1, 2020
Fix incorrect comment in regexp parser
1 parent 12ae8fe commit b5c1787

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎acorn/src/regexp.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ pp.regexp_pattern = function(state) {
152152
if (state.eat(0x29 /* ) */)) {
153153
state.raise("Unmatched ')'")
154154
}
155-
if (state.eat(0x5D /* [ */) || state.eat(0x7D /* } */)) {
155+
if (state.eat(0x5D /* ] */) || state.eat(0x7D /* } */)) {
156156
state.raise("Lone quantifier brackets")
157157
}
158158
}
@@ -837,7 +837,7 @@ pp.regexp_eatCharacterClass = function(state) {
837837
if (state.eat(0x5B /* [ */)) {
838838
state.eat(0x5E /* ^ */)
839839
this.regexp_classRanges(state)
840-
if (state.eat(0x5D /* [ */)) {
840+
if (state.eat(0x5D /* ] */)) {
841841
return true
842842
}
843843
// Unreachable since it threw "unterminated regular expression" error before.
@@ -885,7 +885,7 @@ pp.regexp_eatClassAtom = function(state) {
885885
}
886886

887887
const ch = state.current()
888-
if (ch !== 0x5D /* [ */) {
888+
if (ch !== 0x5D /* ] */) {
889889
state.lastIntValue = ch
890890
state.advance()
891891
return true

0 commit comments

Comments
 (0)
Please sign in to comment.