Fix being unable to parse files with other line endings

This commit is contained in:
0x4261756D 2024-02-21 16:04:35 +01:00
parent 8b30b34bd1
commit 3d40351771

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text.Json; using System.Text.Json;
@ -30,7 +30,8 @@ public class Program
} }
public static void Run(string file, bool debug) 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) if(debug)
{ {
foreach(Token token in tokens) foreach(Token token in tokens)