public void TestEnv() { var global = new Env(null); var main = new Env(global); var tok = new Word("some_var", Tag.ID); var id = new Id(tok, Sara.Type.Int, 0xff); global.AddIdentifier(tok, id); Assert.ReferenceEquals(id, main.Get(tok)); Assert.IsNull(global.Get(new Token(Tag.ID))); }
public Env(Env prev) { this.SymbolTable = new Dictionary<Token, Id>(); this.Prev = prev; }