From b5c17877ac0511e31579ea31e7650ba1a5871e51 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Sun, 1 Mar 2020 13:31:53 +0100 Subject: [PATCH] Fix incorrect comment in regexp parser --- acorn/src/regexp.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/acorn/src/regexp.js b/acorn/src/regexp.js index ee19bcf55..62bebbb29 100644 --- a/acorn/src/regexp.js +++ b/acorn/src/regexp.js @@ -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") } } @@ -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. @@ -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