Package org.sonar.python.checks
Class Expressions
- java.lang.Object
-
- org.sonar.python.checks.Expressions
-
public class Expressions extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisFalsy(Expression expression)static ExpressionremoveParentheses(Expression expression)static ExpressionsingleAssignedValue(Name name)static Stringunescape(StringElement stringElement)static Stringunescape(StringLiteral stringLiteral)
-
-
-
Method Detail
-
isFalsy
public static boolean isFalsy(@Nullable Expression expression)
-
singleAssignedValue
public static Expression singleAssignedValue(Name name)
-
removeParentheses
public static Expression removeParentheses(@Nullable Expression expression)
-
unescape
public static String unescape(StringLiteral stringLiteral)
- Returns:
- concatenation of all underlying StringElement text values without quotes and with escape sequences replacement.
- See Also:
- 2.4.1. String and Bytes literals
-
unescape
public static String unescape(StringElement stringElement)
- Returns:
- the string content of the given StringElement text values without quotes and with escape sequences replacement.
- See Also:
- 2.4.1. String and Bytes literals
-
-