Skip to content

Commit b469d55

Browse files
committed
Python: Fix a few things in Stmts.qll.
1 parent 5744356 commit b469d55

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

python/ql/src/semmle/python/Stmts.qll

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,10 @@ class AugAssign extends AugAssign_ {
9090
/* syntax: Expr += Expr */
9191
override Expr getASubExpression() { result = this.getOperation() }
9292

93+
/** Gets the target of this augmented assignment statement. */
9394
Expr getTarget() { result = this.getOperation().(BinaryExpr).getLeft() }
9495

96+
/** Gets the value of this augmented assignment statement. */
9597
Expr getValue() { result = this.getOperation().(BinaryExpr).getRight() }
9698

9799
override Stmt getASubStatement() { none() }
@@ -405,22 +407,25 @@ class TemplateWrite extends TemplateWrite_ {
405407
override Stmt getASubStatement() { none() }
406408
}
407409

410+
/** An asynchronous `for` statement, such as `async for varname in Expr: ...` */
408411
class AsyncFor extends For {
409412
/* syntax: async for varname in Expr: ... */
410413
AsyncFor() { this.isAsync() }
411414
}
412415

416+
/** An asynchronous `with` statement, such as `async with varname as Expr: ...` */
413417
class AsyncWith extends With {
414418
/* syntax: async with Expr as varname: ... */
415419
AsyncWith() { this.isAsync() }
416420
}
417421

418422
/** A list of statements */
419423
class StmtList extends StmtList_ {
420-
/** Whether this list of statements contains s */
424+
/** Holds if this list of statements contains the AST node `a` */
421425
predicate contains(AstNode a) {
422426
exists(Stmt item | item = this.getAnItem() | item = a or item.contains(a))
423427
}
424428

429+
/** Gets the last item in this list of statements. */
425430
Stmt getLastItem() { result = this.getItem(max(int i | exists(this.getItem(i)))) }
426431
}

0 commit comments

Comments
 (0)