public ElizFunction FindMethod(string name) { if (methods.ContainsKey(name)) { return(methods[name]); } if (baseclass != null) { return(baseclass.FindMethod(name)); } return(null); }
public object Get(Token name) { if (fields.ContainsKey(name.Lexeme)) { return(fields[name.Lexeme]); } ElizFunction method = klass.FindMethod(name.Lexeme); if (method != null) { return(method.Bind(this)); } throw new RuntimeError(name, $"Undefined property '{name.Lexeme}'."); }