C#: Minor edits.

This commit is contained in:
Calum Grant
2019-06-03 14:47:15 +01:00
parent 5679a72f37
commit 73c2898666
2 changed files with 6 additions and 8 deletions

View File

@@ -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;
}

View File

@@ -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