diff --git a/RegExpSupport/test/org/intellij/lang/regexp/ParseTest.java b/RegExpSupport/test/org/intellij/lang/regexp/ParseTest.java deleted file mode 100644 index 4ceccc03f2cc..000000000000 --- a/RegExpSupport/test/org/intellij/lang/regexp/ParseTest.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2006 Sascha Weinreuter - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.intellij.lang.regexp; - -public class ParseTest extends BaseParseTestCase { - - //public void test0() throws Throwable { - // myFixture.testHighlighting("test0.regexp"); - //} - public void test1() throws Throwable { - myFixture.testHighlighting("test1.regexp"); - } - public void test2() throws Throwable { - myFixture.testHighlighting("test2.regexp"); - } - public void test3() throws Throwable { - myFixture.testHighlighting("test3.regexp"); - } - public void test4() throws Throwable { - myFixture.testHighlighting("test4.regexp"); - } -} diff --git a/RegExpSupport/test/org/intellij/lang/regexp/RegExpParsingTest.java b/RegExpSupport/test/org/intellij/lang/regexp/RegExpParsingTest.java index 8aba439916e9..c755e1ff7717 100644 --- a/RegExpSupport/test/org/intellij/lang/regexp/RegExpParsingTest.java +++ b/RegExpSupport/test/org/intellij/lang/regexp/RegExpParsingTest.java @@ -319,4 +319,8 @@ public class RegExpParsingTest extends ParsingTestCase { public void testBug8() throws IOException { doCodeTest(/* fixme */"a\\ b"); } public void testBug9() throws IOException { doCodeTest("(^|\\.)\\*(?=(\\.|$))"); } public void testBug10() throws IOException { doCodeTest("\\h \\H \\v \\V"); } + + public void testParse1() throws IOException { doCodeTest("123 | 456"); } + public void testParse2() throws IOException { doCodeTest("1**"); } + public void testParse3() throws IOException { doCodeTest("(([hH][tT]{2}[pP]|[fF][tT][pP])://)?[a-zA-Z0-9\\-]+(\\.[a-zA-Z0-9\\-]+)*"); } } diff --git a/RegExpSupport/testData/psi/Parse1.txt b/RegExpSupport/testData/psi/Parse1.txt new file mode 100644 index 000000000000..0a63cef9d31e --- /dev/null +++ b/RegExpSupport/testData/psi/Parse1.txt @@ -0,0 +1,21 @@ +REGEXP_FILE + RegExpPatternImpl: <123 | 456> + RegExpBranchImpl: <123 > + RegExpCharImpl: <1> + PsiElement(CHARACTER)('1') + RegExpCharImpl: <2> + PsiElement(CHARACTER)('2') + RegExpCharImpl: <3> + PsiElement(CHARACTER)('3') + RegExpCharImpl: < > + PsiElement(CHARACTER)(' ') + PsiElement(UNION)('|') + RegExpBranchImpl: < 456> + RegExpCharImpl: < > + PsiElement(CHARACTER)(' ') + RegExpCharImpl: <4> + PsiElement(CHARACTER)('4') + RegExpCharImpl: <5> + PsiElement(CHARACTER)('5') + RegExpCharImpl: <6> + PsiElement(CHARACTER)('6') \ No newline at end of file diff --git a/RegExpSupport/testData/psi/Parse2.txt b/RegExpSupport/testData/psi/Parse2.txt new file mode 100644 index 000000000000..7143305b062b --- /dev/null +++ b/RegExpSupport/testData/psi/Parse2.txt @@ -0,0 +1,11 @@ +REGEXP_FILE + RegExpPatternImpl: <1*> + RegExpBranchImpl: <1*> + RegExpClosureImpl: <1*> + RegExpCharImpl: <1> + PsiElement(CHARACTER)('1') + RegExpQuantifierImpl: <*> + PsiElement(STAR)('*') + PsiErrorElement:Dangling metacharacter + + PsiElement(STAR)('*') \ No newline at end of file diff --git a/RegExpSupport/testData/psi/Parse3.txt b/RegExpSupport/testData/psi/Parse3.txt new file mode 100644 index 000000000000..34eb722c7439 --- /dev/null +++ b/RegExpSupport/testData/psi/Parse3.txt @@ -0,0 +1,141 @@ +REGEXP_FILE + RegExpPatternImpl: <(([hH][tT]{2}[pP]|[fF][tT][pP])://)?[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)*> + RegExpBranchImpl: <(([hH][tT]{2}[pP]|[fF][tT][pP])://)?[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)*> + RegExpClosureImpl: <(([hH][tT]{2}[pP]|[fF][tT][pP])://)?> + RegExpGroupImpl: <(([hH][tT]{2}[pP]|[fF][tT][pP])://)> + PsiElement(GROUP_BEGIN)('(') + RegExpPatternImpl: <([hH][tT]{2}[pP]|[fF][tT][pP])://> + RegExpBranchImpl: <([hH][tT]{2}[pP]|[fF][tT][pP])://> + RegExpGroupImpl: <([hH][tT]{2}[pP]|[fF][tT][pP])> + PsiElement(GROUP_BEGIN)('(') + RegExpPatternImpl: <[hH][tT]{2}[pP]|[fF][tT][pP]> + RegExpBranchImpl: <[hH][tT]{2}[pP]> + RegExpClassImpl: <[hH]> + PsiElement(CLASS_BEGIN)('[') + RegExpUnionImpl: + RegExpCharImpl: + PsiElement(CHARACTER)('h') + RegExpCharImpl: + PsiElement(CHARACTER)('H') + PsiElement(CLASS_END)(']') + RegExpClosureImpl: <[tT]{2}> + RegExpClassImpl: <[tT]> + PsiElement(CLASS_BEGIN)('[') + RegExpUnionImpl: + RegExpCharImpl: + PsiElement(CHARACTER)('t') + RegExpCharImpl: + PsiElement(CHARACTER)('T') + PsiElement(CLASS_END)(']') + RegExpQuantifierImpl: <{2}> + PsiElement(LBRACE)('{') + PsiElement(NUMBER)('2') + PsiElement(RBRACE)('}') + RegExpClassImpl: <[pP]> + PsiElement(CLASS_BEGIN)('[') + RegExpUnionImpl: + RegExpCharImpl:

+ PsiElement(CHARACTER)('p') + RegExpCharImpl:

+ PsiElement(CHARACTER)('P') + PsiElement(CLASS_END)(']') + PsiElement(UNION)('|') + RegExpBranchImpl: <[fF][tT][pP]> + RegExpClassImpl: <[fF]> + PsiElement(CLASS_BEGIN)('[') + RegExpUnionImpl: + RegExpCharImpl: + PsiElement(CHARACTER)('f') + RegExpCharImpl: + PsiElement(CHARACTER)('F') + PsiElement(CLASS_END)(']') + RegExpClassImpl: <[tT]> + PsiElement(CLASS_BEGIN)('[') + RegExpUnionImpl: + RegExpCharImpl: + PsiElement(CHARACTER)('t') + RegExpCharImpl: + PsiElement(CHARACTER)('T') + PsiElement(CLASS_END)(']') + RegExpClassImpl: <[pP]> + PsiElement(CLASS_BEGIN)('[') + RegExpUnionImpl: + RegExpCharImpl:

+ PsiElement(CHARACTER)('p') + RegExpCharImpl:

+ PsiElement(CHARACTER)('P') + PsiElement(CLASS_END)(']') + PsiElement(GROUP_END)(')') + RegExpCharImpl: <:> + PsiElement(CHARACTER)(':') + RegExpCharImpl: + PsiElement(CHARACTER)('/') + RegExpCharImpl: + PsiElement(CHARACTER)('/') + PsiElement(GROUP_END)(')') + RegExpQuantifierImpl: + PsiElement(QUEST)('?') + RegExpClosureImpl: <[a-zA-Z0-9\-]+> + RegExpClassImpl: <[a-zA-Z0-9\-]> + PsiElement(CLASS_BEGIN)('[') + RegExpUnionImpl: + RegExpCharRangeImpl: + RegExpCharImpl: + PsiElement(CHARACTER)('a') + PsiElement(MINUS)('-') + RegExpCharImpl: + PsiElement(CHARACTER)('z') + RegExpCharRangeImpl: + RegExpCharImpl: + PsiElement(CHARACTER)('A') + PsiElement(MINUS)('-') + RegExpCharImpl: + PsiElement(CHARACTER)('Z') + RegExpCharRangeImpl: <0-9> + RegExpCharImpl: <0> + PsiElement(CHARACTER)('0') + PsiElement(MINUS)('-') + RegExpCharImpl: <9> + PsiElement(CHARACTER)('9') + RegExpCharImpl: <\-> + PsiElement(ESC_CHARACTER)('\-') + PsiElement(CLASS_END)(']') + RegExpQuantifierImpl: <+> + PsiElement(PLUS)('+') + RegExpClosureImpl: <(\.[a-zA-Z0-9\-]+)*> + RegExpGroupImpl: <(\.[a-zA-Z0-9\-]+)> + PsiElement(GROUP_BEGIN)('(') + RegExpPatternImpl: <\.[a-zA-Z0-9\-]+> + RegExpBranchImpl: <\.[a-zA-Z0-9\-]+> + RegExpCharImpl: <\.> + PsiElement(ESC_CHARACTER)('\.') + RegExpClosureImpl: <[a-zA-Z0-9\-]+> + RegExpClassImpl: <[a-zA-Z0-9\-]> + PsiElement(CLASS_BEGIN)('[') + RegExpUnionImpl: + RegExpCharRangeImpl: + RegExpCharImpl: + PsiElement(CHARACTER)('a') + PsiElement(MINUS)('-') + RegExpCharImpl: + PsiElement(CHARACTER)('z') + RegExpCharRangeImpl: + RegExpCharImpl: + PsiElement(CHARACTER)('A') + PsiElement(MINUS)('-') + RegExpCharImpl: + PsiElement(CHARACTER)('Z') + RegExpCharRangeImpl: <0-9> + RegExpCharImpl: <0> + PsiElement(CHARACTER)('0') + PsiElement(MINUS)('-') + RegExpCharImpl: <9> + PsiElement(CHARACTER)('9') + RegExpCharImpl: <\-> + PsiElement(ESC_CHARACTER)('\-') + PsiElement(CLASS_END)(']') + RegExpQuantifierImpl: <+> + PsiElement(PLUS)('+') + PsiElement(GROUP_END)(')') + RegExpQuantifierImpl: <*> + PsiElement(STAR)('*') \ No newline at end of file diff --git a/RegExpSupport/testData/psi/test1.regexp b/RegExpSupport/testData/psi/test1.regexp deleted file mode 100644 index 0e3e0f80d7d9..000000000000 --- a/RegExpSupport/testData/psi/test1.regexp +++ /dev/null @@ -1 +0,0 @@ -123 | 456 \ No newline at end of file diff --git a/RegExpSupport/testData/psi/test2.regexp b/RegExpSupport/testData/psi/test2.regexp deleted file mode 100644 index 3de5e496926d..000000000000 --- a/RegExpSupport/testData/psi/test2.regexp +++ /dev/null @@ -1 +0,0 @@ -1** \ No newline at end of file diff --git a/RegExpSupport/testData/psi/test3.regexp b/RegExpSupport/testData/psi/test3.regexp deleted file mode 100644 index 0134ceba1e06..000000000000 --- a/RegExpSupport/testData/psi/test3.regexp +++ /dev/null @@ -1 +0,0 @@ -(([hH][tT]{2}[pP]|[fF][tT][pP])://)?[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)* \ No newline at end of file diff --git a/RegExpSupport/testData/psi/test4.regexp b/RegExpSupport/testData/psi/test4.regexp deleted file mode 100644 index 0134ceba1e06..000000000000 --- a/RegExpSupport/testData/psi/test4.regexp +++ /dev/null @@ -1 +0,0 @@ -(([hH][tT]{2}[pP]|[fF][tT][pP])://)?[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)* \ No newline at end of file