From 17a8beb2b7f84033745536b4e1a9f789133495fe Mon Sep 17 00:00:00 2001 From: 0x4261756D <38735823+0x4261756D@users.noreply.github.com> Date: Wed, 21 Feb 2024 16:04:58 +0100 Subject: [PATCH] Don't attempt to parse empty token streams --- Program.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Program.cs b/Program.cs index c71dbcb..40d0d56 100644 --- a/Program.cs +++ b/Program.cs @@ -39,6 +39,10 @@ public class Program Console.WriteLine($"{token.region}: {token.type} {{{token.data}}}"); } } + if(tokens.Length == 0) + { + return; + } if(Path.GetFileName(file).StartsWith("tokenizer")) { Console.WriteLine($"Skipping parsing of `{file}`");