mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
C#: Synthesize an empty body for primary constructors.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using System.IO;
|
||||
using Microsoft.CodeAnalysis.CSharp;
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Semmle.Extraction.Entities;
|
||||
using Semmle.Extraction.Kinds;
|
||||
|
||||
namespace Semmle.Extraction.CSharp.Entities.Statements
|
||||
{
|
||||
internal class SyntheticEmptyBlock : Statement<BlockSyntax>
|
||||
{
|
||||
private SyntheticEmptyBlock(Context cx, BlockSyntax block, IStatementParentEntity parent, int child, Location location)
|
||||
: base(cx, block, StmtKind.BLOCK, parent, child, location) { }
|
||||
|
||||
public static SyntheticEmptyBlock Create(Context cx, IStatementParentEntity parent, int child, Location location)
|
||||
{
|
||||
var block = SyntaxFactory.Block();
|
||||
var ret = new SyntheticEmptyBlock(cx, block, parent, child, location);
|
||||
ret.TryPopulate();
|
||||
return ret;
|
||||
}
|
||||
|
||||
protected override void PopulateStatement(TextWriter trapFile) { }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user