[Nice-commit] Nice/src/bossa/syntax NiceMethod.java,1.29,1.30 DefaultMethodImplementation.java,1.6,1
Brought to you by:
bonniot
From: <bo...@us...> - 2004-03-02 16:14:37
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25647/src/bossa/syntax Modified Files: NiceMethod.java DefaultMethodImplementation.java Log Message: Allow explicit method overrides. Index: NiceMethod.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/NiceMethod.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** NiceMethod.java 2 Mar 2004 12:18:41 -0000 1.29 --- NiceMethod.java 2 Mar 2004 16:02:44 -0000 1.30 *************** *** 48,52 **** FormalParameters params, Statement body, ! Contract contract) { // it is a class method, there is an implicit "this" argument --- 48,53 ---- FormalParameters params, Statement body, ! Contract contract, ! boolean isOverride) { // it is a class method, there is an implicit "this" argument *************** *** 126,133 **** if (body == null) ! return new NiceMethod(name, constraint, returnType, params, contract); else return NiceMethod.WithDefault.create ! (name, constraint, returnType, params, body, contract); } --- 127,135 ---- if (body == null) ! return new NiceMethod(name, constraint, returnType, params, contract, ! isOverride); else return NiceMethod.WithDefault.create ! (name, constraint, returnType, params, body, contract, isOverride); } *************** *** 135,145 **** Constraint constraint, Monotype returnType, FormalParameters parameters, ! Contract contract) { super(name, constraint, returnType, parameters, contract); this.returnTypeLocation = returnType.location(); bossa.link.Dispatch.register(this); } private bossa.util.Location returnTypeLocation; --- 137,149 ---- Constraint constraint, Monotype returnType, FormalParameters parameters, ! Contract contract, boolean isOverride) { super(name, constraint, returnType, parameters, contract); + this.isOverride = isOverride; this.returnTypeLocation = returnType.location(); bossa.link.Dispatch.register(this); } + private boolean isOverride; private bossa.util.Location returnTypeLocation; *************** *** 296,307 **** FormalParameters parameters, Statement body, ! Contract contract) { if (body == null) return new NiceMethod ! (name, constraint, returnType, parameters, contract); return new DefaultMethodImplementation ! (name, constraint, returnType, parameters, contract, body); } --- 300,311 ---- FormalParameters parameters, Statement body, ! Contract contract, boolean isOverride) { if (body == null) return new NiceMethod ! (name, constraint, returnType, parameters, contract, isOverride); return new DefaultMethodImplementation ! (name, constraint, returnType, parameters, contract, isOverride, body); } *************** *** 310,317 **** Constraint constraint, Monotype returnType, FormalParameters parameters, ! Contract contract, DefaultMethodImplementation impl) { ! super(name, constraint, returnType, parameters, contract); this.implementation = impl; } --- 314,321 ---- Constraint constraint, Monotype returnType, FormalParameters parameters, ! Contract contract, boolean isOverride, DefaultMethodImplementation impl) { ! super(name, constraint, returnType, parameters, contract, isOverride); this.implementation = impl; } Index: DefaultMethodImplementation.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/DefaultMethodImplementation.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DefaultMethodImplementation.java 28 Feb 2004 14:23:43 -0000 1.6 --- DefaultMethodImplementation.java 2 Mar 2004 16:02:44 -0000 1.7 *************** *** 29,38 **** Monotype returnType, FormalParameters parameters, ! Contract contract, Statement body) { super(name, body, getAnyPatterns(parameters, name.location())); this.declaration = new NiceMethod.WithDefault ! (name, constraint, returnType, parameters, contract, this); addChild(declaration); } --- 29,38 ---- Monotype returnType, FormalParameters parameters, ! Contract contract, boolean isOverride, Statement body) { super(name, body, getAnyPatterns(parameters, name.location())); this.declaration = new NiceMethod.WithDefault ! (name, constraint, returnType, parameters, contract, isOverride, this); addChild(declaration); } |