-
Notifications
You must be signed in to change notification settings - Fork 1
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
kev
committed
Jan 27, 2024
1 parent
0db26aa
commit 6cb40ce
Showing
20 changed files
with
146 additions
and
8 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
File renamed without changes.
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,11 @@ | ||
using CLVMDotNet.CLVM; | ||
using CLVMDotNet.Tools.IR; | ||
|
||
namespace CLVMDotNet.Tools.Stages.Stage2; | ||
|
||
public static class Bindings | ||
{ | ||
public static SExp Brun => BinUtils.Assemble("(a 2 3)"); | ||
|
||
public static SExp Run => BinUtils.Assemble("(a (opt (com 2)) 3)"); | ||
} |
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,6 @@ | ||
namespace CLVMDotNet.Tools.Stages.Stage2; | ||
|
||
public class Compile | ||
{ | ||
|
||
} |
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,6 @@ | ||
namespace CLVMDotNet.Tools.Stages.Stage2; | ||
|
||
public class Defaults | ||
{ | ||
|
||
} |
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,6 @@ | ||
namespace CLVMDotNet.Tools.Stages.Stage2; | ||
|
||
public class Helpers | ||
{ | ||
|
||
} |
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,6 @@ | ||
namespace CLVMDotNet.Tools.Stages.Stage2; | ||
|
||
public class Mod | ||
{ | ||
|
||
} |
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,6 @@ | ||
namespace CLVMDotNet.Tools.Stages.Stage2; | ||
|
||
public class Operators | ||
{ | ||
|
||
} |
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,9 @@ | ||
using CLVMDotNet.CLVM; | ||
using CLVMDotNet.Tools.IR; | ||
|
||
namespace CLVMDotNet.Tools.Stages.Stage2; | ||
|
||
public class Optimize | ||
{ | ||
|
||
} |
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,6 @@ | ||
namespace CLVMDotNet.Tests.Tools.Stages.Stage0; | ||
|
||
public class Stage0 | ||
{ | ||
|
||
} |
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,49 @@ | ||
using CLVMDotNet.Tools.Stages.Stage2; | ||
using Xunit; | ||
|
||
namespace CLVMDotNet.Tests.Tools.Stages.Stage2; | ||
|
||
public class BindingTests | ||
{ | ||
[Fact] | ||
public void TestBrun() | ||
{ | ||
// Arrange | ||
|
||
// Act | ||
var brun = Bindings.Brun; | ||
|
||
// Assert | ||
Assert.Null(brun.Atom); | ||
Assert.NotNull(brun.Pair); | ||
Assert.True(brun.AsPair().Item1.AsAtom().SequenceEqual(new byte[] { 0x02 })); | ||
Assert.Null(brun.AsPair().Item1.Pair); | ||
Assert.Null(brun.AsPair().Item2.Atom); | ||
Assert.NotNull(brun.AsPair().Item2.Pair); | ||
Assert.True(brun.AsPair().Item2.AsPair().Item1.AsAtom().SequenceEqual(new byte[] { 0x02})); | ||
Assert.Null(brun.AsPair().Item2.AsPair().Item2.Atom); | ||
Assert.NotNull(brun.AsPair().Item2.AsPair().Item2.Pair); | ||
Assert.True(brun.AsPair().Item2.AsPair().Item2.AsPair().Item1.AsAtom().SequenceEqual(new byte []{ 0x03})); | ||
Assert.Empty(brun.AsPair().Item2.AsPair().Item2.AsPair().Item2.AsAtom()); | ||
} | ||
|
||
[Fact(Skip = "Skipping for now")] | ||
public void TestRun() | ||
{ | ||
// Arrange | ||
|
||
// Act | ||
var run = Bindings.Run; | ||
|
||
// Assert | ||
Assert.Null(run.Atom); | ||
Assert.True(run.AsPair().Item1.AsAtom().SequenceEqual(new byte[] { 0x02 })); | ||
Assert.Null(run.AsPair().Item1.Pair); | ||
Assert.Null(run.AsPair().Item2.Atom); | ||
Assert.NotNull(run.AsPair().Item2.Pair); | ||
Assert.NotNull(run.AsPair().Item2.AsPair().Item2); | ||
Assert.NotNull(run.AsPair().Item2.AsPair().Item1); | ||
|
||
|
||
} | ||
} |
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,6 @@ | ||
namespace CLVMDotNet.Tests.Tools.Stages.Stage2; | ||
|
||
public class CompileTests | ||
{ | ||
|
||
} |
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,6 @@ | ||
namespace CLVMDotNet.Tests.Tools.Stages.Stage2; | ||
|
||
public class DefaultsTests | ||
{ | ||
|
||
} |
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,6 @@ | ||
namespace CLVMDotNet.Tests.Tools.Stages.Stage2; | ||
|
||
public class HelperTests | ||
{ | ||
|
||
} |
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,6 @@ | ||
namespace CLVMDotNet.Tests.Tools.Stages.Stage2; | ||
|
||
public class ModTests | ||
{ | ||
|
||
} |
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,6 @@ | ||
namespace CLVMDotNet.Tests.Tools.Stages.Stage2; | ||
|
||
public class OperatorTests | ||
{ | ||
|
||
} |
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,6 @@ | ||
namespace CLVMDotNet.Tests.Tools.Stages.Stage2; | ||
|
||
public class OptimizeTests | ||
{ | ||
|
||
} |