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());
}
}
+1
View File
@@ -0,0 +1 @@
global using Xunit;
+29
View File
@@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\UIX.Asm\UIX.Asm.csproj" />
</ItemGroup>
</Project>