mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Django template parser: error on wrong ids in member parsing (PY-2342).
This commit is contained in:
@@ -2,8 +2,11 @@ package com.jetbrains.python;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
@@ -241,7 +244,7 @@ public class PyNames {
|
||||
* @param name what to check
|
||||
* @return true iff name is not reserved and is a well-formed identifier.
|
||||
*/
|
||||
public static boolean isIdentifier(@NonNls String name) {
|
||||
public static boolean isIdentifier(@NotNull @NonNls String name) {
|
||||
return ! isReserved(name) && IDENTIFIER_PATTERN.matcher(name).matches();
|
||||
}
|
||||
|
||||
|
||||
@@ -664,7 +664,7 @@ public class PyUtil {
|
||||
return name.startsWith("__") && !name.endsWith("__");
|
||||
}
|
||||
|
||||
public static boolean isPythonIdentifier(String name) {
|
||||
public static boolean isPythonIdentifier(@NotNull String name) {
|
||||
return PyNames.isIdentifier(name);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user