public static MyError BadAttributeError(PyObj pyObj, IdentifierSegment identifierSegment) { return(new MyError(String.Format("El atributo: {0} no existe en el tipo: {1}", identifierSegment.Id, TypeConstants.GetMyTypeName(pyObj.GetMyType())) )); }
//Retorna error o memblock public Word GetMember(IdentifierSegment identifierSegment) { if (Visitor == null) { throw new Exception("Tiene que inicializar visitor con InitVisitor antes de usar cualquier GetMember"); } var result = Visitor.GetGlobalAttribute(identifierSegment); var firstResult = result; if (!result.IsError()) { return(result); } foreach (var import in Imports) { result = import.GetMember(identifierSegment); if (!result.IsError()) { return(result); } } return(firstResult); }
public Word GetGlobalAttribute(IdentifierSegment identifierSegment) { return(GlobalScope.Get(identifierSegment.Id)); }