public void ReserveLocal(string name) { if (ContainsLocalByName(name)) { throw new InvalidOperationException($"A local named \"{name}\" already exists in the current scope or an enclosing scope"); } LocalScopes.LastOrDefault().Add(name); }
public void ExitLocalScope() { LocalScopes.RemoveAt(LocalScopes.Count - 1); }
public void EnterLocalScope() { LocalScopes.Add(new HashSet <string>()); }