-
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.
Added special handling for statements instead of just being arrays.
- Loading branch information
Showing
4 changed files
with
52 additions
and
3 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
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
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,26 @@ | ||
using System.Collections.Generic; | ||
namespace EzrSquared.Runtime.Nodes; | ||
|
||
/// <summary> | ||
/// The <see cref="Node"/> structure for holding multiple statements. | ||
/// </summary> | ||
/// <param name="statements">The statements.</param> | ||
/// <param name="startPosition">The starting <see cref="Position"/> of the <see cref="StatementsNode"/>.</param> | ||
/// <param name="endPosition">The ending <see cref="Position"/> of the <see cref="StatementsNode"/>.</param> | ||
public class StatementsNode(List<Node> statements, Position startPosition, Position endPosition) : Node(startPosition, endPosition) | ||
{ | ||
/// <summary> | ||
/// The statements being held by the node. | ||
/// </summary> | ||
public List<Node> Statements = statements; | ||
|
||
/// <inheritdoc/> | ||
public override string ToString() | ||
{ | ||
string[] elements = new string[Statements.Count]; | ||
for (int i = 0; i < Statements.Count; i++) | ||
elements[i] = Statements[i].ToString(); | ||
|
||
return $"{nameof(StatementsNode)}([{string.Join(", ", elements)}])"; | ||
} | ||
} |
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