Wiki

Changeset 2317

Show
Ignore:
Timestamp:
03/14/10 07:30:32 (2 years ago)
Author:
Chuck.Esterbrook
Message:

Code cleanup.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • cobra/trunk/Source/Types.cobra

    r2316 r2317  
    10081008 
    10091009 
    1010 class CharType 
    1011     is partial 
    1012     inherits PrimitiveType 
     1010class CharType inherits PrimitiveType is partial 
    10131011 
    10141012    cue init 
     
    10201018        return 'char' 
    10211019 
    1022     def isComparableTo(b as IType) as bool 
    1023         r = base.isComparableTo(b) 
    1024         if not r and b is .compiler.stringType 
    1025             r = true 
    1026         return r 
     1020    def isComparableTo(t as IType) as bool 
     1021        return base.isComparableTo(t) or t is .compiler.stringType 
    10271022 
    10281023    def isEquatableTo(t as IType) as bool 
    1029         r = base.isEquatableTo(t) 
    1030         if not r and t is .compiler.stringType 
    1031             r = true 
    1032         return r 
    1033  
    1034  
    1035 class DecimalType 
    1036     inherits AbstractNumberType 
     1024        return base.isEquatableTo(t) or t is .compiler.stringType 
     1025 
     1026 
     1027class DecimalType inherits AbstractNumberType 
    10371028 
    10381029    cue init 
     
    10451036 
    10461037    def isComparableTo(t as IType) as bool 
    1047         r = base.isComparableTo(t) 
    1048         if not r and t inherits IntType 
    1049             r = true 
    1050         return r 
     1038        return base.isComparableTo(t) or t inherits IntType 
    10511039 
    10521040 
     
    11821170 
    11831171    def isComparableTo(t as IType) as bool 
    1184         r = base.isComparableTo(t) 
    1185         if not r 
    1186             if t inherits IntType 
    1187                 r = true 
    1188             else if t inherits FloatType 
    1189                 r = true 
    1190         return r 
     1172        return base.isComparableTo(t) or t inherits IntType or t inherits FloatType 
    11911173 
    11921174    def greatestCommonDenominatorWith(type as IType) as IType is override 
     
    13211303 
    13221304    def isComparableTo(t as IType) as bool 
    1323         r = base.isComparableTo(t) 
    1324         if not r 
    1325             if t inherits IntType 
    1326                 r = true 
    1327             else if t inherits DecimalType or t inherits FloatType 
    1328                 r = true 
    1329         return r 
     1305        return base.isComparableTo(t) or t inherits IntType or t inherits DecimalType or t inherits FloatType 
    13301306 
    13311307    def greatestCommonDenominatorWith(type as IType) as IType is override