From 3d40351771bee1be99cf2f663fe50775de8892e4 Mon Sep 17 00:00:00 2001 From: 0x4261756D <38735823+0x4261756D@users.noreply.github.com> Date: Wed, 21 Feb 2024 16:04:35 +0100 Subject: [PATCH] Fix being unable to parse files with other line endings --- Program.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Program.cs b/Program.cs index 9dd987f..c71dbcb 100644 --- a/Program.cs +++ b/Program.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Text.Json; @@ -30,7 +30,8 @@ public class Program } public static void Run(string file, bool debug) { - Token[] tokens = new Tokenizer().Tokenize(File.ReadAllText(file)); + string content = File.ReadAllText(file).ReplaceLineEndings(); + Token[] tokens = new Tokenizer().Tokenize(content); if(debug) { foreach(Token token in tokens)