Initial work on compilation to C#
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using Upsilon;
|
||||
using Upsilon.Binder;
|
||||
using Upsilon.Evaluator;
|
||||
using UpsilonCompiler;
|
||||
|
||||
namespace Yc
|
||||
{
|
||||
@@ -34,6 +35,10 @@ namespace Yc
|
||||
continue;
|
||||
}
|
||||
|
||||
var compiler = new Compiler();
|
||||
var compiled = compiler.CompileToCSharp(parsed.Bind());
|
||||
Console.WriteLine(compiled);
|
||||
/*
|
||||
var evaluate = parsed.Evaluate();
|
||||
if (parsed.Diagnostics.Messages.Count > 0)
|
||||
{
|
||||
@@ -50,7 +55,7 @@ namespace Yc
|
||||
Console.ForegroundColor = ConsoleColor.Cyan;
|
||||
Console.WriteLine(evaluate);
|
||||
Console.ResetColor();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
@@ -6,6 +6,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\UpsilonCompiler\UpsilonCompiler.csproj" />
|
||||
<ProjectReference Include="..\Upsilon\Upsilon.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user