-
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.
- Loading branch information
1 parent
ae470f5
commit 622b09f
Showing
8 changed files
with
143 additions
and
89 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
35 changes: 35 additions & 0 deletions
35
...es.RedGreen/Tsu.Trees.RedGreen.SourceGenerator.Generator/Sample/Internal/GreenWalker.g.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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// <auto-generated /> | ||
|
||
#nullable enable | ||
|
||
namespace Tsu.Trees.RedGreen.Sample.Internal | ||
{ | ||
internal abstract class SampleWalker : global::Tsu.Trees.RedGreen.Sample.Internal.SampleVisitor | ||
{ | ||
private int _recursionDepth; | ||
|
||
public override void Visit(global::Tsu.Trees.RedGreen.Sample.Internal.GreenNode? node) | ||
{ | ||
if (node != null) | ||
{ | ||
_recursionDepth++; | ||
if (_recursionDepth > 30) | ||
{ | ||
global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); | ||
} | ||
|
||
node.Accept(this); | ||
|
||
_recursionDepth--; | ||
} | ||
} | ||
|
||
protected override void DefaultVisit(global::Tsu.Trees.RedGreen.Sample.Internal.GreenNode node) | ||
{ | ||
foreach (var child in node.ChildNodes()) | ||
{ | ||
Visit(child); | ||
} | ||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...ted/Tsu.Trees.RedGreen/Tsu.Trees.RedGreen.SourceGenerator.Generator/Sample/RedWalker.g.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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// <auto-generated /> | ||
|
||
#nullable enable | ||
|
||
namespace Tsu.Trees.RedGreen.Sample | ||
{ | ||
public abstract class SampleWalker : global::Tsu.Trees.RedGreen.Sample.SampleVisitor | ||
{ | ||
private int _recursionDepth; | ||
|
||
public override void Visit(global::Tsu.Trees.RedGreen.Sample.SampleNode? node) | ||
{ | ||
if (node != null) | ||
{ | ||
_recursionDepth++; | ||
if (_recursionDepth > 30) | ||
{ | ||
global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); | ||
} | ||
|
||
node.Accept(this); | ||
|
||
_recursionDepth--; | ||
} | ||
} | ||
|
||
protected override void DefaultVisit(global::Tsu.Trees.RedGreen.Sample.SampleNode node) | ||
{ | ||
foreach (var child in node.ChildNodes()) | ||
{ | ||
Visit(child); | ||
} | ||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
Tsu.Trees.RedGreen/src/Templates/Internal/GreenWalker.sbn-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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// <auto-generated /> | ||
|
||
#nullable enable | ||
|
||
namespace {{ green_base.namespace_no_global }} | ||
{ | ||
{{ green_base.accessibility }} abstract class {{ suffix }}Walker : {{ green_base.namespace }}.{{ suffix }}Visitor | ||
{ | ||
private int _recursionDepth; | ||
|
||
public override void Visit({{ green_base.csharp_no_nullable }}? node) | ||
{ | ||
if (node != null) | ||
{ | ||
_recursionDepth++; | ||
if (_recursionDepth > 30) | ||
{ | ||
global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); | ||
} | ||
|
||
node.Accept(this); | ||
|
||
_recursionDepth--; | ||
} | ||
} | ||
|
||
protected override void DefaultVisit({{ green_base.csharp_no_nullable }} node) | ||
{ | ||
foreach (var child in node.ChildNodes()) | ||
{ | ||
Visit(child); | ||
} | ||
} | ||
} | ||
} |
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,35 @@ | ||
// <auto-generated /> | ||
|
||
#nullable enable | ||
|
||
namespace {{ red_base.namespace_no_global }} | ||
{ | ||
{{ red_base.accessibility }} abstract class {{ suffix }}Walker : {{ red_base.namespace }}.{{ suffix }}Visitor | ||
{ | ||
private int _recursionDepth; | ||
|
||
public override void Visit({{ red_base.csharp_no_nullable }}? node) | ||
{ | ||
if (node != null) | ||
{ | ||
_recursionDepth++; | ||
if (_recursionDepth > 30) | ||
{ | ||
global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); | ||
} | ||
|
||
node.Accept(this); | ||
|
||
_recursionDepth--; | ||
} | ||
} | ||
|
||
protected override void DefaultVisit({{ red_base.csharp_no_nullable }} node) | ||
{ | ||
foreach (var child in node.ChildNodes()) | ||
{ | ||
Visit(child); | ||
} | ||
} | ||
} | ||
} |
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