-
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.
Introducing BoundTreeVisitor and BoundTreeWalker (#104)
- Loading branch information
Showing
39 changed files
with
349 additions
and
128 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
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
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
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
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
27 changes: 14 additions & 13 deletions
27
src/Todl.Compiler/CodeAnalysis/Binding/BoundTree/BoundExpressionStatement.cs
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 |
---|---|---|
@@ -1,18 +1,19 @@ | ||
using Todl.Compiler.CodeAnalysis.Syntax; | ||
|
||
namespace Todl.Compiler.CodeAnalysis.Binding.BoundTree | ||
namespace Todl.Compiler.CodeAnalysis.Binding.BoundTree; | ||
|
||
[BoundNode] | ||
internal sealed class BoundExpressionStatement : BoundStatement | ||
{ | ||
[BoundNode] | ||
public sealed class BoundExpressionStatement : BoundStatement | ||
{ | ||
public BoundExpression Expression { get; internal init; } | ||
} | ||
public BoundExpression Expression { get; internal init; } | ||
|
||
public override BoundNode Accept(BoundTreeVisitor visitor) => visitor.VisitBoundExpressionStatement(this); | ||
} | ||
|
||
public partial class Binder | ||
{ | ||
private BoundExpressionStatement BindExpressionStatement(ExpressionStatement expressionStatement) | ||
=> BoundNodeFactory.CreateBoundExpressionStatement( | ||
syntaxNode: expressionStatement, | ||
expression: BindExpression(expressionStatement.Expression)); | ||
} | ||
public partial class Binder | ||
{ | ||
private BoundExpressionStatement BindExpressionStatement(ExpressionStatement expressionStatement) | ||
=> BoundNodeFactory.CreateBoundExpressionStatement( | ||
syntaxNode: expressionStatement, | ||
expression: BindExpression(expressionStatement.Expression)); | ||
} |
Oops, something went wrong.