mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
WI-60779 Support PCRE "pseudo" conditions DEFINE and VERSION as conditions in conditional groups.
GitOrigin-RevId: bdf83d81e0235826d7980739025f90581bc4222c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c2abcf40d8
commit
a58330a1c1
@@ -331,6 +331,21 @@ public class RegExpLexerTest extends LexerTestCase {
|
||||
doTest("(a)\\g-105", null, lexer);
|
||||
}
|
||||
|
||||
public void testPcreConditionDefine() {
|
||||
final RegExpLexer lexer = new RegExpLexer(EnumSet.of(PCRE_CONDITIONS));
|
||||
doTest("(?(DEFINE)(?<Name>\\w+))(?P>Name)", null, lexer);
|
||||
}
|
||||
|
||||
public void testPcreConditionVersion() {
|
||||
final RegExpLexer lexer = new RegExpLexer(EnumSet.of(PCRE_CONDITIONS));
|
||||
doTest("(?(VERSION>=10.7)yes|no)", null, lexer);
|
||||
}
|
||||
|
||||
public void testNoPcreCondition() {
|
||||
final RegExpLexer lexer = new RegExpLexer(EnumSet.noneOf(RegExpCapability.class));
|
||||
doTest("(?(DEFINE)(?<Name>\\w+))(?P>Name)", null, lexer);
|
||||
}
|
||||
|
||||
public void testNoNestedCharacterClasses1() {
|
||||
final RegExpLexer lexer = new RegExpLexer(EnumSet.noneOf(RegExpCapability.class));
|
||||
doTest("[[\\]]", "CLASS_BEGIN ('[')\n" +
|
||||
|
||||
Reference in New Issue
Block a user