Ticket #8: forDeprec.patch
File forDeprec.patch, 2.2 KB (added by hopscc, 17 years ago) |
---|
patches for deprec warnings and fixes to CobraLang |
-
CobraParser.cobra
1857 1857 deprecated 2008-03: the use of .. and ++ just doesn't relate to anything 1858 1858 See forEnumerableStmt below. 1859 1859 """ 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") 1860 1862 .expect('ASSIGN') 1861 1863 start = .expression 1862 1864 .expect('DOTDOT') -
CobraLang.cobra
924 958 if obj.getType.name.startsWith('List`') 925 959 dobj = obj to dynamic 926 960 count = dobj.count to int 927 for j = 0 ..count961 for j in 0:count 928 962 try 929 963 value = dobj[j] 930 964 catch exc as Exception … … 1061 1095 _args = $sharp(r'(object[])args.Clone()') 1062 1096 _locals = Dictionary<of String, dynamic?>() 1063 1097 _localNamesInOrder = List<of String>() 1064 for j = 0 .. _args.length ++21098 for j in 0:_args.length:2 1065 1099 .setLocal(_args[j] to String, _args[j+1]) 1066 1100 1067 1101 def setLocal(name as String, value as dynamic?) … … 1073 1107 nameWidth = 8 1074 1108 tw.writeLine('\n [i]. [this]') 1075 1109 tw.writeLine(' args') 1076 for j = 0 .. _args.length ++21110 for j in 0:_args.length:2 1077 1111 tw.write(String.format(' {0} = ', (_args[j] to String).padRight(nameWidth))) 1078 1112 try 1079 1113 s = CobraCore.toTechString(_args[j+1]) … … 1101 1135 tw.writeLine('<tr class=frameHead> <td class=number> [i]. </td> <td class=qualifiedMember colspan=4> [_declClassName].[_methodName] </td> </tr> ') 1102 1136 tw.writeLine('<tr class=frameDetails1> <td class=indent> </td> <td class=label width=1> at: </td> <td class=sourceLocation colspan=3> [SourceSite.htmlForAtArgs(_fileName, _lineNum)] </td> </tr>') 1103 1137 rowNum = 1 1104 for j = 0 .. _args.length ++21138 for j in 0:_args.length:2 1105 1139 name = _args[j] to String 1106 1140 value = _args[j+1] to dynamic? 1107 1141 label = if(j==0, 'args:', '')