Merge pull request #2397 from tausbn/python-make-tostrings-visible

Python: Add `toString` information for all classes without such.
This commit is contained in:
Rasmus Wriedt Larsen
2019-11-21 11:46:22 +01:00
committed by GitHub
5 changed files with 8 additions and 8 deletions

View File

@@ -93,7 +93,7 @@ class Copy extends @duplication_or_similarity
}
/** Gets a textual representation of this element. */
string toString() { none() }
string toString() { result = "Copy" }
/**
* Gets a block that extends this one, that is, its first token is also

View File

@@ -419,7 +419,7 @@ abstract class Num extends Num_, ImmutableLiteral {
/* We want to declare this abstract, but currently we cannot. */
override string toString() {
none()
result = "Num with missing toString"
}
}

View File

@@ -60,7 +60,7 @@ abstract class DictUnpackingOrKeyword extends DictItem {
abstract Expr getValue();
override string toString() {
none()
result = "DictUnpackingOrKeyword with missing toString"
}
}
@@ -70,7 +70,7 @@ abstract class DictDisplayItem extends DictItem {
abstract Expr getValue();
override string toString() {
none()
result = "DictDisplayItem with missing toString"
}
}

View File

@@ -13,7 +13,7 @@ library class CfgOrigin extends @py_object {
string toString() {
/* Not to be displayed */
none()
result = "CfgOrigin"
}
/** Get a `ControlFlowNode` from `this` or `here`.
@@ -68,7 +68,7 @@ module CfgOrigin {
//
// string toString() {
// /* Not to be displayed */
// none()
// result = "CfgOrigin"
// }
//
// /** Get a `ControlFlowNode` from `this` or `here`.

View File

@@ -20,7 +20,7 @@ import semmle.python.objects.ObjectInternal
abstract class PointsToExtension extends @py_flow_node {
string toString() { none() }
string toString() { result = "PointsToExtension with missing toString" }
abstract predicate pointsTo(Context context, ObjectInternal value, ControlFlowNode origin);
@@ -36,7 +36,7 @@ abstract class PointsToExtension extends @py_flow_node {
/** DEPRECATED -- Use PointsToExtension instead */
deprecated abstract class CustomPointsToFact extends @py_flow_node {
string toString() { none() }
string toString() { result = "CustomPointsToFact with missing toString" }
abstract predicate pointsTo(Context context, Object value, ClassObject cls, ControlFlowNode origin);