mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
C#: Minor edits.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Semmle.Extraction.CSharp.Entities.Expressions;
|
||||
using Semmle.Extraction.Kinds;
|
||||
@@ -9,9 +8,11 @@ namespace Semmle.Extraction.CSharp.Entities.Statements
|
||||
{
|
||||
static StmtKind GetKind(LocalDeclarationStatementSyntax declStmt)
|
||||
{
|
||||
if (declStmt.UsingKeyword.RawKind != 0) return StmtKind.USING_DECL;
|
||||
if (declStmt.UsingKeyword.RawKind != 0)
|
||||
return StmtKind.USING_DECL;
|
||||
|
||||
if (declStmt.IsConst) return StmtKind.CONST_DECL;
|
||||
if (declStmt.IsConst)
|
||||
return StmtKind.CONST_DECL;
|
||||
|
||||
return StmtKind.VAR_DECL;
|
||||
}
|
||||
|
||||
@@ -1115,7 +1115,7 @@ class LockStmt extends Stmt, @lock_stmt {
|
||||
}
|
||||
|
||||
/**
|
||||
* A using block or declaration. Either a using declaration (`UsingDecStmt`) or
|
||||
* A using block or declaration. Either a using declaration (`UsingDeclStmt`) or
|
||||
* a using block (`UsingBlockStmt`).
|
||||
*/
|
||||
class UsingStmt extends Stmt, @using_stmt {
|
||||
@@ -1123,7 +1123,7 @@ class UsingStmt extends Stmt, @using_stmt {
|
||||
LocalVariableDeclExpr getVariableDeclExpr(int i) { none() }
|
||||
|
||||
/** Gets a local variable declaration of this `using` statement. */
|
||||
LocalVariableDeclExpr getAVariableDeclExpr() { none() }
|
||||
LocalVariableDeclExpr getAVariableDeclExpr() { result = this.getVariableDeclExpr(_) }
|
||||
|
||||
/**
|
||||
* DEPRECATED: Use UsingBlockStmt.getExpr() instead.
|
||||
@@ -1165,9 +1165,6 @@ class UsingBlockStmt extends UsingStmt, @using_block_stmt {
|
||||
/** Gets the `i`th local variable declaration of this `using` statement. */
|
||||
override LocalVariableDeclExpr getVariableDeclExpr(int i) { result = this.getChild(-i - 1) }
|
||||
|
||||
/** Gets a local variable declaration of this `using` statement. */
|
||||
override LocalVariableDeclExpr getAVariableDeclExpr() { result = this.getVariableDeclExpr(_) }
|
||||
|
||||
/**
|
||||
* Gets the expression directly used by this `using` statement, if any. For
|
||||
* example, `f` on line 2 in
|
||||
|
||||
Reference in New Issue
Block a user