Changeset 1583
- Timestamp:
- 08/18/08 12:28:50 (3 months ago)
- Location:
- cobra/trunk/Source
- Files:
-
- 12 modified
-
Attributes.cobra (modified) (1 diff)
-
BinaryOpExpr.cobra (modified) (3 diffs)
-
Boxes.cobra (modified) (1 diff)
-
CobraParser.cobra (modified) (3 diffs)
-
Compiler.cobra (modified) (1 diff)
-
Enums.cobra (modified) (2 diffs)
-
Expr.cobra (modified) (3 diffs)
-
Members.cobra (modified) (6 diffs)
-
Property.cobra (modified) (1 diff)
-
Statements.cobra (modified) (1 diff)
-
Types.cobra (modified) (1 diff)
-
Utils.cobra (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cobra/trunk/Source/Attributes.cobra
r1573 r1583 65 65 sw.write(sep) 66 66 if arg inherits AssignExpr 67 sw.write( Utils.capped((arg.left to dynamic).name))67 sw.write(((arg.left to dynamic).name to String).capped) # CC: wouldn't need this if extension methods were registered with dynamic binder 68 68 sw.write('=') 69 69 arg = arg.right -
cobra/trunk/Source/BinaryOpExpr.cobra
r1577 r1583 356 356 _left.left.writeSharpDef(sw, false) 357 357 sw.write(', ') 358 sw.write(Utils.sharpStringLiteralFor( Utils.capped((_left.right to MemberExpr).name)))358 sw.write(Utils.sharpStringLiteralFor((_left.right to MemberExpr).name.capped)) 359 359 sw.write(', ') 360 360 _right.writeSharpDef(sw) … … 1018 1018 _left.writeSharpDef(sw, not _left inherits DotExpr) 1019 1019 sw.write(', ') 1020 sw.write(Utils.sharpStringLiteralFor( Utils.capped(_right.name)))1020 sw.write(Utils.sharpStringLiteralFor(_right.name.capped)) 1021 1021 sw.write(')') 1022 1022 else if _right inherits CallExpr … … 1025 1025 _left.writeSharpDef(sw, not _left inherits DotExpr) 1026 1026 sw.write(', ') 1027 sw.write(Utils.sharpStringLiteralFor( Utils.capped(_right.name)))1027 sw.write(Utils.sharpStringLiteralFor(_right.name.capped)) 1028 1028 for arg in _right.args 1029 1029 sw.write(', ') -
cobra/trunk/Source/Boxes.cobra
r1573 r1583 2225 2225 decl.recordError('Extensions can only contain methods, not initializers.') 2226 2226 else 2227 decl.sharedMethodBacking = '[sharpName].[ Utils.capped(decl.name)]'2227 decl.sharedMethodBacking = '[sharpName].[decl.name.capped]' 2228 2228 decl.isNames.remove('virtual') 2229 2229 decl.isNames.add('nonvirtual') -
cobra/trunk/Source/CobraParser.cobra
r1582 r1583 1043 1043 if decl inherits Box 1044 1044 if not (decl inherits Class or decl inherits Struct) 1045 .throwError(decl.token, '[ Utils.capped(decl.englishName)] cannot be "partial".')1045 .throwError(decl.token, '[decl.englishName.capped] cannot be "partial".') 1046 1046 checkForDups = false 1047 1047 otherDecl = ns.unifiedNameSpace.declForName(decl.name) … … 1061 1061 return otherDecl 1062 1062 else 1063 .throwError(decl.token, '[ Utils.capped(decl.englishName)] cannot be "partial".')1063 .throwError(decl.token, '[decl.englishName.capped] cannot be "partial".') 1064 1064 if checkForDups 1065 1065 if ns.declForName(decl.name) … … 1208 1208 name = opener.value to String 1209 1209 curBox = .curBox 1210 if name == curBox.name or Utils.capped(name)== curBox.name1210 if name == curBox.name or name.capped == curBox.name 1211 1211 .throwError('Method names cannot be the same as their enclosing [curBox.englishName]. Use `def init` for creating an initializer/constructor or choose another name.') # TODO list the enclosing types location 1212 1212 overload = _overloadIfNeeded(curBox, name) # also checks for various errors -
cobra/trunk/Source/Compiler.cobra
r1574 r1583 1549 1549 # *sigh* 1550 1550 if fileName.length>=2 and fileName[1]==c':' 1551 fileName = Utils.capped(fileName)1551 fileName = fileName.capped 1552 1552 1553 1553 # TODO: handle relative paths like ..\foo.cobra which C# spells out as absolute paths -
cobra/trunk/Source/Enums.cobra
r1573 r1583 109 109 110 110 get sharpInit as String is override 111 return .sharpRef + '.' + Utils.capped(_declsInOrder[0].name)111 return .sharpRef + '.' + _declsInOrder[0].name.capped 112 112 113 113 def writeSharpDef(sw as SharpWriter) is override … … 126 126 for em as EnumMember in .declsInOrder 127 127 sw.write(sep) 128 sw.write( Utils.capped(em.name))128 sw.write(em.name.capped) 129 129 if em.value 130 130 sw.write(' = [em.value]') -
cobra/trunk/Source/Expr.cobra
r1582 r1583 729 729 name = (_definition to BoxMember).binaryName to ! 730 730 else 731 name = Utils.capped(name)731 name = name.capped 732 732 sw.write('[name]') 733 733 if _genericArgTypes and _genericArgTypes.count … … 1610 1610 name = _definition.binaryName 1611 1611 if name is nil 1612 name = Utils.capped(_name)1612 name = _name.capped 1613 1613 sw.write(name) 1614 1614 if _definition and (_definition.isMethod or _name=='toString') and not _isReference # TODO: axe the 'toString' check … … 2435 2435 2436 2436 def writeSharpDef(sw as SharpWriter, parens as bool) is override 2437 sw.write('CobraImp.[ Utils.capped(.opName)](')2437 sw.write('CobraImp.[.opName.capped](') 2438 2438 .expr.writeSharpDefInContext(sw) 2439 2439 sw.write(')') -
cobra/trunk/Source/Members.cobra
r1582 r1583 440 440 441 441 get sharpName as String is override 442 return Utils.capped(.name)442 return .name.capped 443 443 444 444 def writeSharpDef(sw as SharpWriter) is override … … 595 595 name = .name 596 596 if not name.startsWith('_') 597 name = Utils.capped(name)597 name = name.capped 598 598 return name 599 599 … … 1474 1474 1475 1475 get sharpName as String is override 1476 return Utils.capped(.name)1476 return .name.capped 1477 1477 1478 1478 … … 1791 1791 member.name.length 1792 1792 body 1793 base.init(token, member.box, 'test_'+ Utils.capped(member.name), List<of Param>(), .getCompiler.voidType, nil, ['shared'], AttributeList(), '')1793 base.init(token, member.box, 'test_'+member.name.capped, List<of Param>(), .getCompiler.voidType, nil, ['shared'], AttributeList(), '') 1794 1794 _forMember = member 1795 1795 … … 1798 1798 box.name.length 1799 1799 body 1800 base.init(token, box, 'test_class_'+ Utils.capped(box.name), List<of Param>(), .getCompiler.voidType, nil, ['shared'], AttributeList(), '')1800 base.init(token, box, 'test_class_'+box.name.capped, List<of Param>(), .getCompiler.voidType, nil, ['shared'], AttributeList(), '') 1801 1801 _forBox = box 1802 1802 … … 1820 1820 get sharpName as String is override 1821 1821 if _forMember 1822 name = 'test_' +Utils.capped(_forMember.name)1822 name = 'test_' + _forMember.name.capped 1823 1823 if .overloadId <> -1 1824 1824 name += '_ol_[.overloadId]' -
cobra/trunk/Source/Property.cobra
r1369 r1583 34 34 .writeSharpAttribs(sw) 35 35 .writeSharpIsNames(sw) 36 sw.write(' [_returnType.sharpRef] [ Utils.capped(.name)]')36 sw.write(' [_returnType.sharpRef] [.name.capped]') 37 37 .writeSharpBody(sw) 38 38 getPart = .getPart -
cobra/trunk/Source/Statements.cobra
r1582 r1583 1297 1297 def writeSharpDef(sw as SharpWriter) 1298 1298 base.writeSharpDef(sw) 1299 name = Utils.capped(.name)1299 name = .name.capped 1300 1300 localName = '_lh_event_[.serialNum]' 1301 1301 sw.writeLine('// raise [.name] ...') -
cobra/trunk/Source/Types.cobra
r1523 r1583 2085 2085 sugg = '' 2086 2086 if not Utils.isCapped(_name) 2087 sugg = Utils.capped(_name)2087 sugg = _name.capped 2088 2088 other = .compiler.symbolForName(sugg, true, false) 2089 2089 sugg = if(other, ' Try "[sugg]".', '') -
cobra/trunk/Source/Utils.cobra
r1541 r1583 5 5 6 6 use System.Reflection 7 8 9 extend String 10 11 def capped as String 12 return Utils.capped(this) 7 13 8 14
