Wiki

Ticket #8: forDeprec.patch

File forDeprec.patch, 2.2 KB (added by hopscc, 16 years ago)

patches for deprec warnings and fixes to CobraLang

  • CobraParser.cobra

     
    18571857        deprecated 2008-03: the use of .. and ++ just doesn't relate to anything 
    18581858        See forEnumerableStmt below. 
    18591859        """ 
     1860        _warning("\nNumericForStatement by assignment (for var = start .. stop) deprecated 2008-03." + _ 
     1861                  " Please change to use new form (for var in start:stop:step) before 2009-03") 
    18601862        .expect('ASSIGN') 
    18611863        start = .expression 
    18621864        .expect('DOTDOT') 
  • CobraLang.cobra

     
    924958            if obj.getType.name.startsWith('List`') 
    925959                dobj = obj to dynamic 
    926960                count = dobj.count to int 
    927                 for j = 0 .. count 
     961                for j in 0:count 
    928962                    try 
    929963                        value = dobj[j] 
    930964                    catch exc as Exception 
     
    10611095            _args = $sharp(r'(object[])args.Clone()') 
    10621096            _locals = Dictionary<of String, dynamic?>() 
    10631097            _localNamesInOrder = List<of String>() 
    1064             for j = 0 .. _args.length ++ 2 
     1098            for j in 0:_args.length:2 
    10651099                .setLocal(_args[j] to String, _args[j+1]) 
    10661100 
    10671101        def setLocal(name as String, value as dynamic?) 
     
    10731107            nameWidth = 8 
    10741108            tw.writeLine('\n    [i]. [this]') 
    10751109            tw.writeLine('        args') 
    1076             for j = 0 .. _args.length ++ 2 
     1110            for j in 0:_args.length:2 
    10771111                tw.write(String.format('               {0} = ', (_args[j] to String).padRight(nameWidth))) 
    10781112                try 
    10791113                    s = CobraCore.toTechString(_args[j+1]) 
     
    11011135            tw.writeLine('<tr class=frameHead> <td class=number> [i]. </td> <td class=qualifiedMember colspan=4> [_declClassName].[_methodName] </td> </tr> ') 
    11021136            tw.writeLine('<tr class=frameDetails1> <td class=indent> &nbsp; </td> <td class=label width=1> at: </td> <td class=sourceLocation colspan=3> [SourceSite.htmlForAtArgs(_fileName, _lineNum)] </td> </tr>') 
    11031137            rowNum = 1 
    1104             for j = 0 .. _args.length ++ 2 
     1138            for j in 0:_args.length:2 
    11051139                name = _args[j] to String 
    11061140                value = _args[j+1] to dynamic? 
    11071141                label = if(j==0, 'args:', '')