public override bool Equals(object other) { var dtOther = other as DataType; if (dtOther == null) { return(false); } if (typeStack.Contains(this, dtOther)) { return(true); } else if (other is DictType) { typeStack.Push(this, dtOther); DictType co = (DictType)other; bool ret = (co.KeyType.Equals(KeyType) && co.ValueType.Equals(ValueType)); typeStack.Pop(this, other); return(ret); } else { return(false); } }
public string VisitDict(DictType d) { // StringBuilder sb = new StringBuilder(); // // Integer num = ctr.visit(this); // if (num != null) { // sb.Append("#").append(num); // } else { // ctr.push(this); // sb.Append("{"); // sb.Append(keyType.printType(ctr)); // sb.Append(" : "); // sb.Append(valueType.printType(ctr)); // sb.Append("}"); // ctr.pop(this); // } // // return sb.toString(); return("dict"); }
private DictType Register(DictType dictType) { dictType.Table.addSuper(analyzer.Builtins.BaseDict.Table); dictType.Table.Path = analyzer.Builtins.BaseDict.Table.Path; return(dictType); }