From 1129ea1f62684f30617009c538e62928c4ae8da1 Mon Sep 17 00:00:00 2001 From: Meep <50252724+DrMeepso@users.noreply.github.com> Date: Fri, 22 Nov 2024 19:28:36 +1300 Subject: [PATCH 1/2] Fix Wrong Token For } --- GDWeave/Script/ScriptTokenizer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GDWeave/Script/ScriptTokenizer.cs b/GDWeave/Script/ScriptTokenizer.cs index 014c741..029679b 100644 --- a/GDWeave/Script/ScriptTokenizer.cs +++ b/GDWeave/Script/ScriptTokenizer.cs @@ -66,7 +66,7 @@ public static class ScriptTokenizer { {"[", TokenType.BracketOpen}, {"]", TokenType.BracketClose}, {"{", TokenType.CurlyBracketOpen}, - {"}", TokenType.CurlyBracketOpen}, + {"}", TokenType.CurlyBracketClose}, {"(", TokenType.ParenthesisOpen}, {")", TokenType.ParenthesisClose}, From 0aaa710dd29f2de99513416cf186fa14e227c74d Mon Sep 17 00:00:00 2001 From: Meep <50252724+DrMeepso@users.noreply.github.com> Date: Fri, 22 Nov 2024 20:16:21 +1300 Subject: [PATCH 2/2] Make tokenizer use tabs and not 4 spaces --- GDWeave/Script/ScriptTokenizer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GDWeave/Script/ScriptTokenizer.cs b/GDWeave/Script/ScriptTokenizer.cs index 029679b..ce0e510 100644 --- a/GDWeave/Script/ScriptTokenizer.cs +++ b/GDWeave/Script/ScriptTokenizer.cs @@ -366,10 +366,10 @@ private static IEnumerable TokenizeString(string text) { yield return ClearBuilder(); var start = i; i++; - for (; i < text.Length && text[i] == ' '; i++) ; + for (; i < text.Length && text[i] == '\t'; i++) ; i--; yield return "\n"; - yield return $"{(i - start) / 4}"; + yield return $"{i - start}"; continue; } }