diff --git a/Program.cs b/Program.cs index 184017e..2972e6c 100644 --- a/Program.cs +++ b/Program.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; @@ -27,12 +27,19 @@ public class Program Token[] tokens = new Tokenizer().Tokenize(File.ReadAllText(file)); if(debug) { - foreach(Token token in tokens) { 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) + { + Console.WriteLine($"\t\t{node.startRegion}-{node.endRegion}: {node.GetType()}"); + } + Console.WriteLine($"\tRetstat: {root.block.retstat?.startRegion}-{root.block.retstat?.endRegion}"); } static readonly Dictionary failedFiles = []; public static void Test(string directory)