mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 02:09:59 +07:00
regexp: lookbehind error highlighting for python
This commit is contained in:
@@ -463,6 +463,11 @@ public class PyStringLiteralExpressionImpl extends PyElementImpl implements PySt
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Lookbehind supportsLookbehind(@NotNull RegExpGroup lookbehindGroup) {
|
||||
return Lookbehind.FIXED_LENGTH_ALTERNATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getQuantifierValue(@NotNull RegExpNumber number) {
|
||||
try {
|
||||
|
||||
7
python/testData/regexp/lookbehind.py
Normal file
7
python/testData/regexp/lookbehind.py
Normal file
@@ -0,0 +1,7 @@
|
||||
import re
|
||||
|
||||
re.compile(r"(?<!a|b)");
|
||||
re.compile(r"(?<!<error descr="Alternation alternatives needs to have the same length inside lookbehind">a|bc</error>)");
|
||||
re.compile(r"(?<!a{3}})");
|
||||
re.compile(r"(?<!a<weak_warning descr="Fixed repetition range">{3,3}</weak_warning>})");
|
||||
re.compile(r"(?<!a<error descr="Unequal min and max in counted quantifier not allowed inside lookbehind">{3,4}</error>})");
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -39,6 +39,10 @@ import java.util.List;
|
||||
*/
|
||||
public class PyRegexpTest extends PyTestCase {
|
||||
|
||||
public void testLookbehind() {
|
||||
doTestHighlighting();
|
||||
}
|
||||
|
||||
public void testCountedQuantifier() {
|
||||
doTestHighlighting();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user