Changeset 1582
- Timestamp:
- 08/18/08 11:40:51 (3 months ago)
- Location:
- cobra/trunk
- Files:
-
- 6 modified
-
Source/CobraParser.cobra (modified) (2 diffs)
-
Source/Expr.cobra (modified) (4 diffs)
-
Source/Members.cobra (modified) (1 diff)
-
Source/Statements.cobra (modified) (1 diff)
-
Tests/200-misc/820-partial/110-partial-multi-file-1.cobra (modified) (1 diff)
-
Tests/200-misc/820-partial/112-partial-multi-file-2.cobra (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cobra/trunk/Source/CobraParser.cobra
r1574 r1582 2529 2529 finally 2530 2530 .opStack.pop 2531 return BinaryOpExpr.make(token to !, 'DOT', ThisLit(token , .curBox), expr)2531 return BinaryOpExpr.make(token to !, 'DOT', ThisLit(token), expr) 2532 2532 else if peek=='NIL' 2533 2533 return NilLiteral(.grab) … … 2537 2537 return BoolLit(.grab) 2538 2538 else if peek=='THIS' 2539 return ThisLit(.grab , .curBox)2539 return ThisLit(.grab) 2540 2540 else if peek=='BASE' 2541 return BaseLit(.grab , .curBox)2541 return BaseLit(.grab) 2542 2542 else if peek=='VAR' 2543 2543 assert _curCodePart -
cobra/trunk/Source/Expr.cobra
r1581 r1582 1748 1748 # _foo(x) --> ._foo(x) 1749 1749 newCall = CallExpr(.token, .name, .args) 1750 dotted = DotExpr(.token, 'DOT', ThisLit(.token , .curCodeMember.box), newCall, true).bindImp1750 dotted = DotExpr(.token, 'DOT', ThisLit(.token), newCall, true).bindImp 1751 1751 _type = dotted.type to IType 1752 1752 _transformTo(dotted) … … 2942 2942 2943 2943 class ThisOrBaseLit 2944 is abstract 2944 2945 inherits AtomicLiteral 2945 2946 def init(token as IToken, box as Box) 2947 base.init(token) 2948 _type = box 2946 """ 2947 The "current box" used to be passed to .init rather than referenced in _bindImp, but that 2948 didn't work well with partial classes. Also, it's not necessary to creating a ThisOrBaseLit. 2949 """ 2950 2951 def init(token as IToken) 2952 base.init(token) 2949 2953 2950 2954 def _bindImp 2951 2955 base._bindImp 2956 _type = .compiler.curBox 2952 2957 if _type inherits Extension 2953 2958 _type = _type.extendedBox … … 2957 2962 inherits ThisOrBaseLit 2958 2963 2959 def init(token as IToken , box as Box)2960 base.init(token , box)2964 def init(token as IToken) 2965 base.init(token) 2961 2966 2962 2967 def checkType is override … … 2984 2989 # "this" (unless C# allows that which I doubt) 2985 2990 2986 def init(token as IToken , box as Box)2987 base.init(token , box)2991 def init(token as IToken) 2992 base.init(token) 2988 2993 2989 2994 get isExplicit as bool -
cobra/trunk/Source/Members.cobra
r1573 r1582 1152 1152 expr = IdentifierExpr(token, decl) to Expr 1153 1153 else 1154 expr = BinaryOpExpr.make(token, 'DOT', ThisLit(token , .box), MemberExpr(token, decl.name)) to Expr1154 expr = BinaryOpExpr.make(token, 'DOT', ThisLit(token), MemberExpr(token, decl.name)) to Expr 1155 1155 stmts.add(AssertStmt(token, IsNotNilExpr(token, expr), nil)) 1156 1156 if stmts.count -
cobra/trunk/Source/Statements.cobra
r1576 r1582 1268 1268 else 1269 1269 # since we don't have 'this', try prepending 'this' 1270 args.insert(0, ThisLit(.token , .compiler.boxStack.peek).bindImp)1270 args.insert(0, ThisLit(.token).bindImp) 1271 1271 else if args.count == 0 and params.count == 2 1272 1272 # missing both 'this' and event args 1273 args.add(ThisLit(.token , .compiler.boxStack.peek).bindImp)1273 args.add(ThisLit(.token).bindImp) 1274 1274 args.add(_postCallForType(params[params.count-1].type)) 1275 1275 else -
cobra/trunk/Tests/200-misc/820-partial/110-partial-multi-file-1.cobra
r1573 r1582 10 10 11 11 def over(i as int) as int is shared 12 assert .foo == 'foo' 12 13 return i * 2 14 15 def bar as String is shared 16 return 'bar' -
cobra/trunk/Tests/200-misc/820-partial/112-partial-multi-file-2.cobra
r1573 r1582 5 5 6 6 def foo as String is shared 7 assert .bar == 'bar' 7 8 return 'foo' 8 9
