Improve Run output
This commit is contained in:
parent
d1b855144e
commit
25b3dd63c5
23
Program.cs
23
Program.cs
@ -1,11 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace luaaaaah;
|
||||
|
||||
public class Program
|
||||
{
|
||||
internal static JsonSerializerOptions options = new()
|
||||
{
|
||||
IncludeFields = true,
|
||||
WriteIndented = true,
|
||||
};
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
switch(args[0])
|
||||
@ -32,14 +38,19 @@ public class Program
|
||||
Console.WriteLine($"{token.region}: {token.type} {{{token.data}}}");
|
||||
}
|
||||
}
|
||||
Parser.ChunkNode root = new Parser().Parse(tokens);
|
||||
Console.WriteLine("Parsed tree:");
|
||||
Console.WriteLine("\tStats:");
|
||||
foreach(Parser.StatNode node in root.block.stats)
|
||||
if(Path.GetFileName(file).StartsWith("tokenizer"))
|
||||
{
|
||||
Console.WriteLine($"\t\t{node.startRegion}-{node.endRegion}: {node.GetType()}");
|
||||
Console.WriteLine($"Skipping parsing of `{file}`");
|
||||
}
|
||||
else
|
||||
{
|
||||
Parser.ChunkNode root = new Parser().Parse(tokens);
|
||||
if(debug)
|
||||
{
|
||||
Console.WriteLine("Parsed tree:");
|
||||
Console.WriteLine(JsonSerializer.Serialize(root, options: options));
|
||||
}
|
||||
}
|
||||
Console.WriteLine($"\tRetstat: {root.block.retstat?.startRegion}-{root.block.retstat?.endRegion}");
|
||||
}
|
||||
static readonly Dictionary<string, string> failedFiles = [];
|
||||
public static void Test(string directory)
|
||||
|
Reference in New Issue
Block a user