Skip to content

Commit b065d87

Browse files
committed
Python: Fixup comments after merge
1 parent 3e2331c commit b065d87

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

python/ql/src/experimental/dataflow/internal/DataFlowPrivate.qll

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,12 @@ private Node update(Node node) {
225225
//--------
226226
// Global flow
227227
//--------
228+
//
228229
/**
229-
* A DataFlowCallable is any callable value.
230+
* IPA type for DataFlowCallable.
231+
*
232+
* A callable is either a callable value or a module (for enclosing `ModuleVariable`s).
233+
* A module has no calls.
230234
*/
231235
newtype TDataFlowCallable =
232236
TCallableValue(CallableValue callable) or
@@ -284,11 +288,24 @@ class DataFlowModuleScope extends DataFlowCallable, TModule {
284288
override string getName() { result = mod.getName() }
285289
}
286290

291+
/**
292+
* IPA type for DataFlowCall.
293+
*
294+
* Calls corresponding to `CallNode`s are either to callable values or to classes.
295+
* The latter is directed to the callable corresponding to the calss' `__init__`-method.
296+
*
297+
* An `__init__`-method can also be called directly, so that callable can be targetted by
298+
* different types of calls. In that case, the parameter mappings will be different,
299+
* as the class call will synthesise an argument node to be mapped to the `self` parameter.
300+
*
301+
* A calls corresponding to a special method call is handled by the corresponding `SpecialMethodCallNode`.
302+
*/
287303
newtype TDataFlowCall =
288304
TCallNode(CallNode call) { call = any(CallableValue c).getACall() } or
289305
TClassCall(CallNode call) { call = any(ClassValue c).getACall() } or
290306
TSpecialCall(SpecialMethodCallNode special)
291307

308+
/** Represents a call. */
292309
abstract class DataFlowCall extends TDataFlowCall {
293310
/** Gets a textual representation of this element. */
294311
abstract string toString();
@@ -306,7 +323,7 @@ abstract class DataFlowCall extends TDataFlowCall {
306323
abstract DataFlowCallable getEnclosingCallable();
307324
}
308325

309-
/** Represents a call to a callable. */
326+
/** Represents a call to a callable (currently only callable values). */
310327
class CallNodeCall extends DataFlowCall, TCallNode {
311328
CallNode call;
312329
DataFlowCallable callable;

0 commit comments

Comments
 (0)