mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
RegExp: report error when atomic groups are not supported
This commit is contained in:
@@ -121,8 +121,8 @@ public final class RegExpLanguageHosts extends ClassExtension<RegExpLanguageHost
|
||||
return host != null && host.supportsPythonConditionalRefs();
|
||||
}
|
||||
|
||||
public boolean supportsPossessiveQuantifiers(@Nullable final RegExpQuantifier quantifier) {
|
||||
final RegExpLanguageHost host = findRegExpHost(quantifier);
|
||||
public boolean supportsPossessiveQuantifiers(@Nullable final RegExpElement context) {
|
||||
final RegExpLanguageHost host = findRegExpHost(context);
|
||||
return host == null || host.supportsPossessiveQuantifiers();
|
||||
}
|
||||
|
||||
|
||||
@@ -280,6 +280,9 @@ public final class RegExpAnnotator extends RegExpElementVisitor implements Annot
|
||||
myHolder.createErrorAnnotation(group, "This named group syntax is not supported");
|
||||
}
|
||||
}
|
||||
if (group.getType() == RegExpGroup.Type.ATOMIC && !myLanguageHosts.supportsPossessiveQuantifiers(group)) {
|
||||
myHolder.createErrorAnnotation(group, "Atomic groups are not supported in this regex dialect");
|
||||
}
|
||||
final String name = group.getName();
|
||||
if (name != null && !myLanguageHosts.isValidGroupName(name, group)) {
|
||||
final ASTNode node = group.getNode().findChildByType(RegExpTT.NAME);
|
||||
|
||||
Reference in New Issue
Block a user