-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 3 source files containing syntax nodes
FinallyBlockSyntax.cs - for the IL finally block; TryBlockSyntax.cs - for the IL .try block, and TryFinallyBlockSyntax.cs - for IL .try { ... } finally { ... } block
- Loading branch information
1 parent
c6596e7
commit 80a1a61
Showing
3 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using ILSourceParser.Trivia; | ||
using System.Collections.Immutable; | ||
|
||
namespace ILSourceParser.Syntax; | ||
|
||
/// <summary> | ||
/// Represents an IL <c>finally</c> block. | ||
/// </summary> | ||
public sealed class FinallyBlockSyntax : SyntaxNode | ||
{ | ||
public override ImmutableArray<SyntaxTrivia> LeadingTrivia { get; init; } | ||
public override ImmutableArray<SyntaxTrivia> TrailingTrivia { get; init; } | ||
|
||
/// <summary> | ||
/// Descendant nodes of the block. | ||
/// </summary> | ||
public IEnumerable<SyntaxNode> DescendantNodes { get; init; } | ||
|
||
internal FinallyBlockSyntax( | ||
ImmutableArray<SyntaxTrivia> leadingTrivia, | ||
ImmutableArray<SyntaxTrivia> trailingTrivia, | ||
IEnumerable<SyntaxNode> descendantNodes) | ||
{ | ||
LeadingTrivia = leadingTrivia; | ||
TrailingTrivia = trailingTrivia; | ||
DescendantNodes = descendantNodes; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using ILSourceParser.Trivia; | ||
using System.Collections.Immutable; | ||
|
||
namespace ILSourceParser.Syntax; | ||
|
||
/// <summary> | ||
/// Represents an IL <c>.try</c> block. | ||
/// </summary> | ||
public sealed class TryBlockSyntax : SyntaxNode | ||
{ | ||
public override ImmutableArray<SyntaxTrivia> LeadingTrivia { get; init; } | ||
public override ImmutableArray<SyntaxTrivia> TrailingTrivia { get; init; } | ||
|
||
/// <summary> | ||
/// Descendant nodes of the block. | ||
/// </summary> | ||
public IEnumerable<SyntaxNode> DescendantNodes { get; init; } | ||
|
||
internal TryBlockSyntax( | ||
ImmutableArray<SyntaxTrivia> leadingTrivia, | ||
ImmutableArray<SyntaxTrivia> trailingTrivia, | ||
IEnumerable<SyntaxNode> descendantNodes) | ||
{ | ||
LeadingTrivia = leadingTrivia; | ||
TrailingTrivia = trailingTrivia; | ||
DescendantNodes = descendantNodes; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using ILSourceParser.Trivia; | ||
using System.Collections.Immutable; | ||
|
||
namespace ILSourceParser.Syntax; | ||
|
||
public sealed class TryFinallyBlockSyntax : SyntaxNode | ||
{ | ||
public override ImmutableArray<SyntaxTrivia> LeadingTrivia { get; init; } | ||
public override ImmutableArray<SyntaxTrivia> TrailingTrivia { get; init; } | ||
public TryBlockSyntax TryBlock { get; init; } | ||
public FinallyBlockSyntax FinallyBlock { get; init; } | ||
|
||
internal TryFinallyBlockSyntax( | ||
ImmutableArray<SyntaxTrivia> leadingTrivia, | ||
ImmutableArray<SyntaxTrivia> trailingTrivia, | ||
TryBlockSyntax tryBlock, | ||
FinallyBlockSyntax finallyBlock) | ||
{ | ||
LeadingTrivia = leadingTrivia; | ||
TrailingTrivia = trailingTrivia; | ||
TryBlock = tryBlock; | ||
FinallyBlock = finallyBlock; | ||
} | ||
} |