From 044afc161375665ed1c33eeddc828477e5100fa6 Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Thu, 29 Oct 2020 16:52:55 +0100 Subject: [PATCH] RegExp: simplify parse error message GitOrigin-RevId: d9a3763a488de4912c850693ea23bf4b714988e4 --- RegExpSupport/resources/messages/RegExpBundle.properties | 3 +-- RegExpSupport/src/org/intellij/lang/regexp/RegExpParser.java | 2 +- RegExpSupport/testData/psi/Groups16.txt | 2 +- RegExpSupport/testData/psi/Groups30.txt | 2 +- RegExpSupport/testData/psi/Groups31.txt | 2 +- RegExpSupport/testData/psi/Groups36.txt | 2 +- RegExpSupport/testData/psi/Groups40.txt | 2 +- RegExpSupport/testData/psi/Groups43.txt | 2 +- RegExpSupport/testData/psi/Regressions1.txt | 2 +- RegExpSupport/testData/psi/Tests2.txt | 2 +- .../com/intellij/java/codeInsight/RegExpHighlightingTest.java | 2 +- 11 files changed, 11 insertions(+), 12 deletions(-) diff --git a/RegExpSupport/resources/messages/RegExpBundle.properties b/RegExpSupport/resources/messages/RegExpBundle.properties index 87ebb0aa49db..0e4258b5a9e2 100644 --- a/RegExpSupport/resources/messages/RegExpBundle.properties +++ b/RegExpSupport/resources/messages/RegExpBundle.properties @@ -123,10 +123,9 @@ parse.error.posix.character.class.name.expected=POSIX character class name expec parse.error.property.name.expected=Property name expected parse.error.property.value.expected=Property value expected parse.error.unclosed.character.class=Unclosed character class -parse.error.unclosed.conditional=Unclosed conditional parse.error.unclosed.group.name=Unclosed group name parse.error.unclosed.group.reference=Unclosed group reference -parse.error.unclosed.group=Unclosed group +parse.error.unclosed.group=')' expected parse.error.unclosed.mysql.character.equivalence.class=Unclosed MySQL character equivalence class parse.error.unclosed.mysql.character.expression=Unclosed MySQL character expression parse.error.unclosed.options.group=Unclosed options group diff --git a/RegExpSupport/src/org/intellij/lang/regexp/RegExpParser.java b/RegExpSupport/src/org/intellij/lang/regexp/RegExpParser.java index 56f17c5ed51e..0b7b4810da60 100644 --- a/RegExpSupport/src/org/intellij/lang/regexp/RegExpParser.java +++ b/RegExpSupport/src/org/intellij/lang/regexp/RegExpParser.java @@ -425,7 +425,7 @@ public class RegExpParser implements PsiParser, LightPsiParser { builder.advanceLexer(); parseBranch(builder); } - checkMatches(builder, RegExpTT.GROUP_END, RegExpBundle.message("parse.error.unclosed.conditional")); + checkMatches(builder, RegExpTT.GROUP_END, RegExpBundle.message("parse.error.unclosed.group")); marker.done(RegExpElementTypes.CONDITIONAL); } else if (type == RegExpTT.PROPERTY) { diff --git a/RegExpSupport/testData/psi/Groups16.txt b/RegExpSupport/testData/psi/Groups16.txt index b98d7e41423c..936317fc73fa 100644 --- a/RegExpSupport/testData/psi/Groups16.txt +++ b/RegExpSupport/testData/psi/Groups16.txt @@ -52,5 +52,5 @@ REGEXP_FILE PsiElement(GROUP_END)(')') PsiElement(GROUP_END)(')') PsiElement(GROUP_END)(')') - PsiErrorElement:Unclosed group + PsiErrorElement:')' expected \ No newline at end of file diff --git a/RegExpSupport/testData/psi/Groups30.txt b/RegExpSupport/testData/psi/Groups30.txt index 1202e7a56035..5515cf8e5d3d 100644 --- a/RegExpSupport/testData/psi/Groups30.txt +++ b/RegExpSupport/testData/psi/Groups30.txt @@ -10,5 +10,5 @@ REGEXP_FILE PsiElement(CARET)('^') RegExpQuantifierImpl: <*> PsiElement(STAR)('*') - PsiErrorElement:Unclosed group + PsiErrorElement:')' expected \ No newline at end of file diff --git a/RegExpSupport/testData/psi/Groups31.txt b/RegExpSupport/testData/psi/Groups31.txt index 1835320da8db..848b99561186 100644 --- a/RegExpSupport/testData/psi/Groups31.txt +++ b/RegExpSupport/testData/psi/Groups31.txt @@ -12,5 +12,5 @@ REGEXP_FILE RegExpPatternImpl: <> RegExpBranchImpl: <> - PsiErrorElement:Unclosed group + PsiErrorElement:')' expected \ No newline at end of file diff --git a/RegExpSupport/testData/psi/Groups36.txt b/RegExpSupport/testData/psi/Groups36.txt index 986ceccfb790..b41bc2f5a63a 100644 --- a/RegExpSupport/testData/psi/Groups36.txt +++ b/RegExpSupport/testData/psi/Groups36.txt @@ -10,5 +10,5 @@ REGEXP_FILE PsiErrorElement:Dangling metacharacter PsiElement(LBRACE)('{') - PsiErrorElement:Unclosed group + PsiErrorElement:')' expected \ No newline at end of file diff --git a/RegExpSupport/testData/psi/Groups40.txt b/RegExpSupport/testData/psi/Groups40.txt index 8d0fa23cc8c8..9f07f0efed79 100644 --- a/RegExpSupport/testData/psi/Groups40.txt +++ b/RegExpSupport/testData/psi/Groups40.txt @@ -33,5 +33,5 @@ REGEXP_FILE PsiErrorElement:Dangling metacharacter PsiElement(LBRACE)('{') - PsiErrorElement:Unclosed conditional + PsiErrorElement:')' expected \ No newline at end of file diff --git a/RegExpSupport/testData/psi/Groups43.txt b/RegExpSupport/testData/psi/Groups43.txt index a97020d84ae2..778d1c238a05 100644 --- a/RegExpSupport/testData/psi/Groups43.txt +++ b/RegExpSupport/testData/psi/Groups43.txt @@ -50,7 +50,7 @@ REGEXP_FILE PsiElement(CHARACTER)('r') RegExpCharImpl: PsiElement(CHARACTER)('n') - PsiErrorElement:Unclosed conditional + PsiErrorElement:')' expected PsiElement(UNION)('|') RegExpBranchImpl: diff --git a/RegExpSupport/testData/psi/Regressions1.txt b/RegExpSupport/testData/psi/Regressions1.txt index e089d661466d..51bf88ce5172 100644 --- a/RegExpSupport/testData/psi/Regressions1.txt +++ b/RegExpSupport/testData/psi/Regressions1.txt @@ -6,5 +6,5 @@ REGEXP_FILE RegExpPatternImpl: <> RegExpBranchImpl: <> - PsiErrorElement:Unclosed group + PsiErrorElement:')' expected \ No newline at end of file diff --git a/RegExpSupport/testData/psi/Tests2.txt b/RegExpSupport/testData/psi/Tests2.txt index e99957feb89b..bfaf5b1dc27f 100644 --- a/RegExpSupport/testData/psi/Tests2.txt +++ b/RegExpSupport/testData/psi/Tests2.txt @@ -11,5 +11,5 @@ REGEXP_FILE PsiElement(CHARACTER)('b') RegExpCharImpl: PsiElement(CHARACTER)('c') - PsiErrorElement:Unclosed group + PsiErrorElement:')' expected \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/RegExpHighlightingTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/RegExpHighlightingTest.java index 6a0182e39275..6096dd182b35 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/RegExpHighlightingTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/RegExpHighlightingTest.java @@ -191,7 +191,7 @@ public class RegExpHighlightingTest extends LightJavaCodeInsightFixtureTestCase } public void testNoNPE() { - doTest("(\");}}//"); + doTest("(\");}}//"); } public void testBadInlineOption() {