RegExp: small simplification

GitOrigin-RevId: aae8e33d12b5252f7c781be9d38782f0aaf7aead
This commit is contained in:
Bas Leijdekkers
2021-07-01 12:28:14 +02:00
committed by intellij-monorepo-bot
parent 554a472101
commit d1a8ea1bc5

View File

@@ -543,11 +543,10 @@ public final class RegExpAnnotator extends RegExpElementVisitor implements Annot
else {
final ASTNode token = quantifier.getToken();
assert token != null;
final String tokenText = token.getText();
if ("?".equals(tokenText) && mySupport == RegExpLanguageHost.Lookbehind.FINITE_REPETITION) {
if (token.getElementType().equals(RegExpTT.QUEST) && mySupport == RegExpLanguageHost.Lookbehind.FINITE_REPETITION) {
return;
}
stopAndReportError(quantifier, RegExpBundle.message("error.0.repetition.not.allowed.inside.lookbehind", tokenText));
stopAndReportError(quantifier, RegExpBundle.message("error.0.repetition.not.allowed.inside.lookbehind", quantifier.getText()));
}
}