Changeset 2297
- Timestamp:
- 03/01/10 05:31:47 (2 years ago)
- Location:
- cobra/trunk
- Files:
-
- 1 added
- 2 modified
-
Source/BinaryOpExpr.cobra (modified) (1 diff)
-
Source/Expr.cobra (modified) (2 diffs)
-
Tests/110-basics-two/500-namespaces/112-dotted-access.cobra (added)
Legend:
- Unmodified
- Added
- Removed
-
cobra/trunk/Source/BinaryOpExpr.cobra
r2231 r2297 635 635 _dotRightExpr = right to IDotRightExpr 636 636 637 def addMinFields 638 base.addMinFields 639 .addField('left.toCobraSource', .safeLeftToCobraSource) 640 .addField('right.toCobraSource', .safeRightToCobraSource) 641 642 def safeLeftToCobraSource as String 643 try 644 return .left.toCobraSource 645 catch exc as Exception 646 return exc.toString 647 648 def safeRightToCobraSource as String 649 try 650 return .right.toCobraSource 651 catch exc as Exception 652 return exc.toString 653 637 654 get definition is override 638 655 """ -
cobra/trunk/Source/Expr.cobra
r2287 r2297 581 581 assert type 582 582 if definition inherits IType # Box, IVar or GenericParam 583 _transformToPostCallExprOnType(d otNode, definition)583 _transformToPostCallExprOnType(definition) 584 584 return 585 585 … … 678 678 return possibleDefinition 679 679 680 def _transformToPostCallExprOnType(dotNode, definition as IType?) 681 # for Foo.Bar() where Bar is a box/type 682 # Change to a PostCallExpr on the type 'Foo.Bar' 683 684 # Roll up Foo.Bar.Baz() into one PostCallExpr 685 transformTarget = dotNode 686 while transformTarget.superNode inherits DotExpr 687 transformTarget = transformTarget.superNode to DotExpr 688 689 postCall = PostCallExpr(.token, TypeExpr(.token, definition), .args).bindImp 690 _type = postCall.type to IType 680 def _transformToPostCallExprOnType(definition as IType?) 681 transformTarget = .superNode to DotExpr 682 postCall = PostCallExpr(.token, TypeExpr(.token, definition), .args).bindAll to PostCallExpr 683 _type = postCall.type 691 684 transformTarget._transformTo(postCall) 692 685



