mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
PY-79967 Introduce a separate method in PyStringLiteralUtil for t-strings
GitOrigin-RevId: 47b1a84c4331aa127a17e4f934c4b1dc28396cf0
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e0e5100499
commit
9d86a1d671
@@ -99,7 +99,14 @@ public final class PyStringLiteralUtil extends PyStringLiteralCoreUtil {
|
||||
* @return whether the given prefix contains either 'f' or 'F' character
|
||||
*/
|
||||
public static boolean isFormattedPrefix(@NotNull String prefix) {
|
||||
return StringUtil.indexOfIgnoreCase(prefix, 'f', 0) >= 0 | StringUtil.indexOfIgnoreCase(prefix, 't', 0) >= 0;
|
||||
return StringUtil.indexOfIgnoreCase(prefix, 'f', 0) >= 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return whether the given prefix contains either 't' or 'T' character
|
||||
*/
|
||||
public static boolean isTemplatePrefix(@NotNull String prefix) {
|
||||
return StringUtil.indexOfIgnoreCase(prefix, 't', 0) >= 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1747,6 +1747,13 @@ public final class PyUtil {
|
||||
return PyStringLiteralUtil.isFormattedPrefix(myPrefix);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if given string node contains "t" or "T" prefix
|
||||
*/
|
||||
public boolean isTemplate() {
|
||||
return PyStringLiteralUtil.isTemplatePrefix(myPrefix);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if other string node has the same decorations, i.e. quotes and prefix
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user