mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
Rust: Add + clean up some QLDoc.
This commit is contained in:
@@ -1,16 +1,23 @@
|
||||
/** Provides classes for assignment operations. */
|
||||
/**
|
||||
* Provides classes for assignment operations.
|
||||
*/
|
||||
|
||||
private import rust
|
||||
private import codeql.rust.elements.internal.BinaryExprImpl
|
||||
|
||||
/** An assignment operation. */
|
||||
/**
|
||||
* An assignment operation, for example:
|
||||
* ```rust
|
||||
* x = y;
|
||||
* x += y;
|
||||
* ```
|
||||
*/
|
||||
abstract private class AssignmentOperationImpl extends Impl::BinaryExpr { }
|
||||
|
||||
final class AssignmentOperation = AssignmentOperationImpl;
|
||||
|
||||
/**
|
||||
* An assignment expression, for example
|
||||
*
|
||||
* An assignment expression, for example:
|
||||
* ```rust
|
||||
* x = y;
|
||||
* ```
|
||||
@@ -22,8 +29,7 @@ final class AssignmentExpr extends AssignmentOperationImpl {
|
||||
}
|
||||
|
||||
/**
|
||||
* A compound assignment expression, for example
|
||||
*
|
||||
* A compound assignment expression, for example:
|
||||
* ```rust
|
||||
* x += y;
|
||||
* ```
|
||||
|
||||
@@ -2,30 +2,48 @@ private import codeql.rust.elements.Expr
|
||||
private import codeql.rust.elements.BinaryExpr
|
||||
private import codeql.rust.elements.PrefixExpr
|
||||
|
||||
/**
|
||||
* A logical operation, such as `&&`, `||` or `!`.
|
||||
*/
|
||||
abstract private class LogicalOperationImpl extends Expr {
|
||||
abstract Expr getAnOperand();
|
||||
}
|
||||
|
||||
final class LogicalOperation = LogicalOperationImpl;
|
||||
|
||||
/**
|
||||
* A binary logical operation, such as `&&` or `||`.
|
||||
*/
|
||||
abstract private class BinaryLogicalOperationImpl extends BinaryExpr, LogicalOperationImpl {
|
||||
override Expr getAnOperand() { result = [this.getLhs(), this.getRhs()] }
|
||||
}
|
||||
|
||||
final class BinaryLogicalOperation = BinaryLogicalOperationImpl;
|
||||
|
||||
/**
|
||||
* The logical and operation, `&&`.
|
||||
*/
|
||||
final class LogicalAndExpr extends BinaryLogicalOperationImpl, BinaryExpr {
|
||||
LogicalAndExpr() { this.getOperatorName() = "&&" }
|
||||
}
|
||||
|
||||
/**
|
||||
* The logical or operation, `||`.
|
||||
*/
|
||||
final class LogicalOrExpr extends BinaryLogicalOperationImpl {
|
||||
LogicalOrExpr() { this.getOperatorName() = "||" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A unary logical operation, such as `!`.
|
||||
*/
|
||||
abstract private class UnaryLogicalOperationImpl extends PrefixExpr, LogicalOperationImpl { }
|
||||
|
||||
final class UnaryLogicalOperation = UnaryLogicalOperationImpl;
|
||||
|
||||
/**
|
||||
* A logical not operation, `!`.
|
||||
*/
|
||||
final class LogicalNotExpr extends UnaryLogicalOperationImpl {
|
||||
LogicalNotExpr() { this.getOperatorName() = "!" }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user