Added initial implementation of UIXA parser

This commit is contained in:
Yoshi Askharoun
2024-01-29 21:42:06 -06:00
parent 5c1469313e
commit 687a6b46d6
8 changed files with 338 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
using Sprache;
using UIX.Asm;
namespace UIX.Test;
public class Assembly
{
[Fact]
public void Test1()
{
const string code =
"""
.import Me as me
.import assembly://UIX/Microsoft.Iris as iris
main:
COBJ 2
PSHC 0
PINI 1
PSHC 1
PINI 2
PINI 0
RETV
RETV
""";
var ast = Lexer.Program.Parse(code);
Assert.NotNull(ast);
Assert.Equal(2, ast.Imports.Count());
Assert.Equal(9, ast.Body.Count());
}
}