diff --git a/Assignment 1/Program.cs b/Assignment 1/Program.cs index 4cefba3..33742a7 100644 --- a/Assignment 1/Program.cs +++ b/Assignment 1/Program.cs @@ -233,6 +233,11 @@ namespace Assignment_1 { throw new ParserException("Cannot assign a value to a reserved constant", 0, keyEndPos - (key.Length + 1)); } + else if (Symbols.ContainsKey(key) && !checkExist) + { + // key already exists, remove it + Symbols.Remove(key); + } source.Position = keyEndPos; } return key;