nice-commit Mailing List for The Nice Programming Language (Page 33)
Brought to you by:
bonniot
You can subscribe to this list here.
2003 |
Jan
|
Feb
(60) |
Mar
(125) |
Apr
(183) |
May
(140) |
Jun
(227) |
Jul
(141) |
Aug
(181) |
Sep
(75) |
Oct
(89) |
Nov
(187) |
Dec
(162) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(69) |
Feb
(197) |
Mar
(98) |
Apr
(26) |
May
(10) |
Jun
(85) |
Jul
(88) |
Aug
(79) |
Sep
(80) |
Oct
(81) |
Nov
(53) |
Dec
(109) |
2005 |
Jan
(68) |
Feb
(77) |
Mar
(232) |
Apr
(79) |
May
(37) |
Jun
(37) |
Jul
(3) |
Aug
(18) |
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
(10) |
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(9) |
2007 |
Jan
(2) |
Feb
(8) |
Mar
(2) |
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
|
Oct
|
Nov
(17) |
Dec
(6) |
2008 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Daniel B. <bo...@us...> - 2004-10-12 18:39:30
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4765/src/bossa/syntax Modified Files: NiceMethod.java Log Message: Take into account existing methods that specialize new ones (not yet for existing Java methods). Index: NiceMethod.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/NiceMethod.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** NiceMethod.java 17 Jun 2004 10:41:13 -0000 1.40 --- NiceMethod.java 12 Oct 2004 18:39:18 -0000 1.41 *************** *** 238,242 **** if (! (Typing.smaller(ourDomain, itsDomain, true)) || Types.typeParameterDispatch(getType(), s.getType())) ! continue; // In a compiled package, we don't need checking. --- 238,256 ---- if (! (Typing.smaller(ourDomain, itsDomain, true)) || Types.typeParameterDispatch(getType(), s.getType())) ! { ! // If the method is imported (so it has not computed what ! // methods it specializes), ! // check if the reverse relation holds with that method ! if (! d.specializesMethods() && ! Typing.smaller(itsDomain, ourDomain, true) && ! ! Types.typeParameterDispatch(getType(), s.getType())) ! { ! // d is a specialized version of this. ! // Therefore, all its implementations also belong to this. ! bossa.link.Alternative.addAll(d, this); ! } ! ! continue; ! } // In a compiled package, we don't need checking. |
From: Daniel B. <bo...@us...> - 2004-10-12 18:39:30
|
Update of /cvsroot/nice/Nice/src/bossa/link In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4765/src/bossa/link Modified Files: Alternative.java Log Message: Take into account existing methods that specialize new ones (not yet for existing Java methods). Index: Alternative.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/link/Alternative.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** Alternative.java 7 Aug 2004 14:20:27 -0000 1.52 --- Alternative.java 12 Oct 2004 18:39:18 -0000 1.53 *************** *** 220,223 **** --- 220,239 ---- } + public static void addAll(MethodDeclaration from, MethodDeclaration to) + { + List list = (List) alternatives.get(from.getFullName()); + + if (list == null) + return; + + String fullName = to.getFullName(); + + for(Iterator i = list.iterator(); i.hasNext();) + { + Alternative a = (Alternative) i.next(); + a.add(fullName); + } + } + public static Stack sortedAlternatives(MethodDeclaration m) { |
From: Daniel B. <bo...@us...> - 2004-10-12 18:39:28
|
Update of /cvsroot/nice/Nice/testsuite/compiler/methods In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4765/testsuite/compiler/methods Added Files: generalization.testsuite Log Message: Take into account existing methods that specialize new ones (not yet for existing Java methods). --- NEW FILE: generalization.testsuite --- /// COMMENT Introducing a method that is more general than an existing one. /// COMMENT That is, the existing one overrides the new one. /// PASS /// package a /// Toplevel class Collection { void foo() {} } /// package b import a /// Toplevel abstract interface Fooable {} <Fooable F> void foo(F this); class a.Collection implements Fooable; /// PASS /// package a /// Toplevel class Collection { void foo() {} } /// package b import a /// Toplevel abstract interface Fooable { void foo(); } class a.Collection implements Fooable; /// PASS bug /// Toplevel abstract interface Addable<T> { void add(T item); } interface java.util.Collection implements Addable; |
From: Daniel B. <bo...@us...> - 2004-10-12 16:57:42
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13889/src/bossa/syntax Modified Files: AbstractInterface.java Log Message: Represent methods defined inside abstract interfaces directly in the AST, instead of as children of the abstract interface. Index: AbstractInterface.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/AbstractInterface.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** AbstractInterface.java 12 Aug 2004 23:21:42 -0000 1.19 --- AbstractInterface.java 12 Oct 2004 16:57:19 -0000 1.20 *************** *** 41,54 **** } - public void addMethod(Definition m) - { - addChild(m); - } - mlsub.typing.TypeSymbol getTypeSymbol() { return itf; } ! /**************************************************************** * Resolution --- 41,49 ---- } mlsub.typing.TypeSymbol getTypeSymbol() { return itf; } ! /**************************************************************** * Resolution *************** *** 81,95 **** } - void resolveBody() - { - if (children != null) - for (Iterator i = children.iterator(); i.hasNext();) - { - Object child = i.next(); - if (child instanceof DefaultMethodImplementation) - ((DefaultMethodImplementation) child).resolveBody(); - } - } - /**************************************************************** * Initial Context --- 76,79 ---- *************** *** 108,112 **** } } ! /**************************************************************** * Module interface --- 92,96 ---- } } ! /**************************************************************** * Module interface *************** *** 121,148 **** + Util.map(" extends ",", ","", superInterfaces) + "{}\n"); - - if (children != null) - for(Iterator i = children.iterator(); i.hasNext(); ) - { - Object o = i.next(); - if (o instanceof Definition) - ((Definition) o).printInterface(w); - } } ! /**************************************************************** * Code generation ****************************************************************/ - public void compile() { - // Compile children methods and functions. - if (children != null) - for(Iterator i = children.iterator(); i.hasNext(); ) - { - Object o = i.next(); - if (o instanceof Definition) - ((Definition) o).compile(); - } } --- 105,115 ---- + Util.map(" extends ",", ","", superInterfaces) + "{}\n"); } ! /**************************************************************** * Code generation ****************************************************************/ public void compile() { } |
From: Daniel B. <bo...@us...> - 2004-10-12 16:57:29
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13889/src/bossa/parser Modified Files: Parser.jj Log Message: Represent methods defined inside abstract interfaces directly in the AST, instead of as children of the abstract interface. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.267 retrieving revision 1.268 diff -C2 -d -r1.267 -r1.268 *** Parser.jj 6 Oct 2004 16:14:02 -0000 1.267 --- Parser.jj 12 Oct 2004 16:57:19 -0000 1.268 *************** *** 1145,1149 **** } ! AbstractInterface interfaceDefinition(Constraint prefix): { LocatedString name; --- 1145,1149 ---- } ! AbstractInterface interfaceDefinition(Constraint prefix, List definitions): { LocatedString name; *************** *** 1165,1169 **** [ "public" | "private" ] m = internalMethodOrFunction(res, false) ! { res.addMethod(m); } )* "}" --- 1165,1169 ---- [ "public" | "private" ] m = internalMethodOrFunction(res, false) ! { definitions.add(m); } )* "}" *************** *** 1599,1603 **** res=customConstructor(cst) | LOOKAHEAD ( "abstract" "interface" ) ! res=interfaceDefinition(cst) | res=classDefinition(cst, definitions, storeDocString) | res=methodDeclaration(cst, false) --- 1599,1603 ---- res=customConstructor(cst) | LOOKAHEAD ( "abstract" "interface" ) ! res=interfaceDefinition(cst, definitions) | res=classDefinition(cst, definitions, storeDocString) | res=methodDeclaration(cst, false) |
From: Arjan B. <ar...@us...> - 2004-10-11 20:01:57
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16515/Nice Modified Files: NEWS Log Message: updated changelog. Index: NEWS =================================================================== RCS file: /cvsroot/nice/Nice/NEWS,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** NEWS 11 Oct 2004 12:34:28 -0000 1.52 --- NEWS 11 Oct 2004 20:01:46 -0000 1.53 *************** *** 3,6 **** --- 3,8 ---- * Better error messages for wrong constructor calls and method implementations with wrong parameter names. + * Bug fixes (disallowed redefinition of parameters, execution order of + initializers in super classes, ... ) -- |
From: Daniel B. <bo...@us...> - 2004-10-11 16:21:48
|
Update of /cvsroot/nice/Nice/testsuite/compiler/abstractInterfaces In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29543/testsuite/compiler/abstractInterfaces Modified Files: existingClass.testsuite Log Message: Disallow Java classes to implement non-abstract new non-abstract interfaces even if the Java class is retyped. Index: existingClass.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/abstractInterfaces/existingClass.testsuite,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** existingClass.testsuite 15 Jul 2004 10:53:29 -0000 1.8 --- existingClass.testsuite 11 Oct 2004 16:21:05 -0000 1.9 *************** *** 110,111 **** --- 110,124 ---- class /*/// FAIL HERE */ java.lang.String implements ITest; test(String a) = "done"; + + /// FAIL + // Making an existing class implement a non-abstract interface + // can only be done with classes defined in Nice. + // Retyped classes are not valid either. + let l = new ArrayList(); + println( l.test() ); + + /// Toplevel + interface ITest<T> { String test(); } + + interface /*/// FAIL HERE */ java.util.Collection implements ITest; + test(Collection a) = "done"; |
From: Daniel B. <bo...@us...> - 2004-10-11 16:21:30
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29543/src/bossa/syntax Modified Files: AbstractInterfaceImplementation.java Log Message: Disallow Java classes to implement non-abstract new non-abstract interfaces even if the Java class is retyped. Index: AbstractInterfaceImplementation.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/AbstractInterfaceImplementation.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AbstractInterfaceImplementation.java 15 Jul 2004 10:53:29 -0000 1.7 --- AbstractInterfaceImplementation.java 11 Oct 2004 16:21:06 -0000 1.8 *************** *** 66,74 **** ClassDefinition def = ClassDefinition.get(classTC); if (def != null) def.addInterfaceImplementation(interfaceITF); - else if (interfaceITF.associatedTC() != null) - User.error(this, classTC + " is not a class defined in Nice.\n" + - "It can only implement abstract interfaces."); createContext(); --- 66,79 ---- ClassDefinition def = ClassDefinition.get(classTC); + + boolean isNiceClass = def != null && + ! (def.getImplementation() instanceof JavaClass); + + if (!isNiceClass && interfaceITF.associatedTC() != null) + User.error(this, className + " is not a class defined in Nice.\n" + + "It can only implement abstract interfaces."); + if (def != null) def.addInterfaceImplementation(interfaceITF); createContext(); |
From: Daniel B. <bo...@us...> - 2004-10-11 15:22:47
|
Update of /cvsroot/nice/Nice/testsuite/compiler/overloading In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15099/testsuite/compiler/overloading Modified Files: specificity.testsuite Log Message: Allow abstract interfaces as additional tags in method implementations. Index: specificity.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/overloading/specificity.testsuite,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** specificity.testsuite 15 Sep 2004 00:47:31 -0000 1.7 --- specificity.testsuite 11 Oct 2004 15:21:33 -0000 1.8 *************** *** 127,128 **** --- 127,142 ---- foo(null) = null; foo(String s) = s; + + /// PASS + /// Toplevel + abstract interface I { + void foo(); + } + + abstract class A { + void foo() {} + } + + class B extends A implements I {} + + foo(B(I) b) {} |
From: Daniel B. <bo...@us...> - 2004-10-11 15:22:47
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15099/src/bossa/syntax Modified Files: Pattern.java Log Message: Allow abstract interfaces as additional tags in method implementations. Index: Pattern.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Pattern.java,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** Pattern.java 15 Sep 2004 00:47:31 -0000 1.92 --- Pattern.java 11 Oct 2004 15:21:34 -0000 1.93 *************** *** 38,41 **** --- 38,42 ---- TypeConstructor tc; TypeConstructor tc2; + mlsub.typing.Interface itf2; // The class constraint verified by this pattern. *************** *** 109,113 **** if (additional != null) { ! tc2 = additional.resolveToTC(scope); additional = null; } --- 110,123 ---- if (additional != null) { ! TypeSymbol sym = additional.resolveToTypeSymbol(scope); ! ! if (sym instanceof TypeConstructor) ! tc2 = (TypeConstructor) sym; ! else if (sym instanceof mlsub.typing.Interface) ! itf2 = (mlsub.typing.Interface) sym; ! else ! User.error(additional, ! additional + " should be a class or an interface"); ! additional = null; } *************** *** 220,223 **** --- 230,235 ---- if (tc2 != null) Typing.leq(tc2, rawType); + else if (itf2 != null) + Typing.assertImp(rawType.head(), itf2, false); } |
From: Daniel B. <bo...@us...> - 2004-10-11 13:56:49
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27022/src/bossa/syntax Modified Files: MethodBodyDefinition.java Log Message: Typo. Index: MethodBodyDefinition.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MethodBodyDefinition.java,v retrieving revision 1.153 retrieving revision 1.154 diff -C2 -d -r1.153 -r1.154 *** MethodBodyDefinition.java 11 Oct 2004 12:34:27 -0000 1.153 --- MethodBodyDefinition.java 11 Oct 2004 13:55:35 -0000 1.154 *************** *** 105,109 **** ((JavaMethod) d).registerForDispatch(); if (TypeConstructors.isInterface(formals[0].tc)) ! User.error(this, name + " is a native method. Dispatch can only occur if the first argument is not a interface."); } else if (! (d instanceof NiceMethod)) --- 105,109 ---- ((JavaMethod) d).registerForDispatch(); if (TypeConstructors.isInterface(formals[0].tc)) ! User.error(this, name + " is a native method. Dispatch can only occur if the first argument is not an interface."); } else if (! (d instanceof NiceMethod)) |
From: Daniel B. <bo...@us...> - 2004-10-11 12:34:43
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10104/src/bossa/syntax Modified Files: MethodBodyDefinition.java Log Message: Give an explicit error message when an implementation is rejected because it uses a wrong parameter name. Index: MethodBodyDefinition.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MethodBodyDefinition.java,v retrieving revision 1.152 retrieving revision 1.153 diff -C2 -d -r1.152 -r1.153 *** MethodBodyDefinition.java 15 Sep 2004 00:47:31 -0000 1.152 --- MethodBodyDefinition.java 11 Oct 2004 12:34:27 -0000 1.153 *************** *** 115,119 **** } ! /** Returns the symbol of the method this declaration belongs to. */ --- 115,139 ---- } ! private static class ErrorList ! { ! private List errors = null; ! boolean multipleErrors = false; ! ! void add(MethodDeclaration method, UserError error) ! { ! if (errors == null) ! errors = new ArrayList(); ! ! errors.add(error); ! } ! ! void report() ! { ! if (errors != null && errors.size() == 1) ! throw (UserError) errors.get(0); ! } ! } ! ! /** Returns the symbol of the method this declaration belongs to. */ *************** *** 130,135 **** // Try to remember what caused the error when no symbol could be found. ! UserError error = null; ! boolean multipleErrors = false; for(Iterator i = symbols.iterator(); i.hasNext();){ --- 150,154 ---- // Try to remember what caused the error when no symbol could be found. ! ErrorList errorList = new ErrorList(); for(Iterator i = symbols.iterator(); i.hasNext();){ *************** *** 172,181 **** } catch (TypingEx e) { ! if (error == null) ! error = new UserError(formals[p], ! "Pattern " + formals[p] + ! " is incompatible with " + domain[p]); ! else ! multipleErrors = true; throw e; --- 191,199 ---- } catch (TypingEx e) { ! errorList.add ! (m, ! new UserError(formals[p], ! "Pattern " + formals[p] + ! " is incompatible with " + domain[p])); throw e; *************** *** 199,203 **** * then try to find the most specific declaration(s) using these tc's * TODO: combine this code with removeNonMinimal in OverloadedSymbolExp ! */ if (symbols.size() > 1 && hasAdditionalTags) { --- 217,221 ---- * then try to find the most specific declaration(s) using these tc's * TODO: combine this code with removeNonMinimal in OverloadedSymbolExp ! */ if (symbols.size() > 1 && hasAdditionalTags) { *************** *** 255,258 **** --- 273,280 ---- if (formals[i].atAny() && formals[i].name != null && params.getName(i) != null && !formals[i].name.toString().equals(params.getName(i).toString())) { + errorList.add(m, + new UserError(formals[i], "Parameter " + formals[i] + + " should be called " + + params.getName(i))); it.remove(); continue outer; *************** *** 268,277 **** if (symbols.size() == 0) { ! if (error != null && ! multipleErrors) ! throw error; ! else ! User.error(this, ! "No method called " + name + ! " is compatible with these patterns"); } --- 290,299 ---- if (symbols.size() == 0) { ! errorList.report(); ! ! // Default message in case we could not produce a better one. ! User.error(this, ! "No method called " + name + ! " is compatible with these patterns"); } |
From: Daniel B. <bo...@us...> - 2004-10-11 12:34:43
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10104 Modified Files: NEWS Log Message: Give an explicit error message when an implementation is rejected because it uses a wrong parameter name. Index: NEWS =================================================================== RCS file: /cvsroot/nice/Nice/NEWS,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** NEWS 6 Oct 2004 13:23:58 -0000 1.51 --- NEWS 11 Oct 2004 12:34:28 -0000 1.52 *************** *** 1,5 **** nice (0.9.10) ! * -- --- 1,6 ---- nice (0.9.10) ! * Better error messages for wrong constructor calls and method ! implementations with wrong parameter names. -- |
From: Francis B. <fb...@us...> - 2004-10-10 13:20:56
|
Update of /cvsroot/nice/Nice/src/nice/tools/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17037/src/nice/tools/doc Modified Files: htmlwriter.nice Log Message: /* and */ are now correctly stripped from global var comments and method comments. Index: htmlwriter.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/doc/htmlwriter.nice,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** htmlwriter.nice 7 Oct 2004 22:03:42 -0000 1.24 --- htmlwriter.nice 10 Oct 2004 13:19:32 -0000 1.25 *************** *** 21,25 **** import java.io.*; ! /** Comment */ int testMethod(double testvar) { --- 21,25 ---- import java.io.*; ! /** TESTCommentTEST */ int testMethod(double testvar) { *************** *** 28,32 **** /** ! *Comment */ class HTMLWriter { --- 28,32 ---- /** ! *Test Class Comment */ class HTMLWriter { *************** *** 151,160 **** //to be able to put their own html in the comment. writer.write("<p>\n"); ! String comments; ! if(gv.docString() != null) ! comments = notNull(gv.docString()); ! else ! comments = "null"; ! writer.write(comments + "\n"); writer.write("</p>\n"); --- 151,161 ---- //to be able to put their own html in the comment. writer.write("<p>\n"); ! if(gv.docString() != null) { ! Comment comm = new Comment(commentStr: notNull(gv.docString())); ! List<(?String, String)> tags = comm.tags; ! //write the general comment ! (?String a, String b) = tags.removeAt(0); ! writer.write(b + "\n"); ! } writer.write("</p>\n"); *************** *** 184,193 **** //to be able to put their own html in the comment. writer.write("<p>\n"); ! String comments; ! if(m.docString() != null) ! comments = notNull(m.docString()); ! else ! comments = "null"; ! writer.write(comments + "\n"); writer.write("</p>"); --- 185,194 ---- //to be able to put their own html in the comment. writer.write("<p>\n"); ! if(m.docString() != null) { ! Comment comm = new Comment(commentStr: notNull(m.docString())); ! List<(?String, String)> tags = comm.tags; ! (?String a, String b) = tags.removeAt(0); ! writer.write(b + "\n"); ! } writer.write("</p>"); |
From: Daniel B. <bo...@us...> - 2004-10-10 12:48:52
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11462/src/bossa/syntax Modified Files: DefaultMethodImplementation.java Log Message: Actually copy the doc string after it is known. Index: DefaultMethodImplementation.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/DefaultMethodImplementation.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** DefaultMethodImplementation.java 10 Oct 2004 12:30:18 -0000 1.9 --- DefaultMethodImplementation.java 10 Oct 2004 12:48:42 -0000 1.10 *************** *** 35,39 **** this.declaration = new NiceMethod.WithDefault (name, constraint, returnType, parameters, contract, isOverride, this); - this.declaration.docString = this.docString; addChild(declaration); } --- 35,38 ---- *************** *** 61,64 **** --- 60,65 ---- void doResolve() { + this.declaration.docString = this.docString; + //scope = declaration.scope; typeScope = declaration.typeScope; |
From: Daniel B. <bo...@us...> - 2004-10-10 12:39:15
|
Update of /cvsroot/nice/Nice/src/nice/tools/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9799/src/nice/tools/doc Modified Files: main.nice Log Message: Added -d option as a short-hand for --outdir. Index: main.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/doc/main.nice,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** main.nice 30 Jun 2004 14:12:36 -0000 1.7 --- main.nice 10 Oct 2004 12:38:57 -0000 1.8 *************** *** 42,46 **** String path => { compilation.packagePath = path; }), ! option("outdir", "Output files to this directory", "path", --- 42,46 ---- String path => { compilation.packagePath = path; }), ! option(letter: 'd', "outdir", "Output files to this directory", "path", |
From: Daniel B. <bo...@us...> - 2004-10-10 12:30:28
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8089/src/bossa/syntax Modified Files: DefaultMethodImplementation.java Log Message: Copy doc strings from default method implementations to their corresponding method declarations. Index: DefaultMethodImplementation.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/DefaultMethodImplementation.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** DefaultMethodImplementation.java 7 Aug 2004 14:20:28 -0000 1.8 --- DefaultMethodImplementation.java 10 Oct 2004 12:30:18 -0000 1.9 *************** *** 35,38 **** --- 35,39 ---- this.declaration = new NiceMethod.WithDefault (name, constraint, returnType, parameters, contract, isOverride, this); + this.declaration.docString = this.docString; addChild(declaration); } |
From: Daniel B. <bo...@us...> - 2004-10-09 10:26:00
|
Update of /cvsroot/nice/Nice/src/gnu/expr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27963/src/gnu/expr Modified Files: ConstructorExp.java Log Message: Simplification. Index: ConstructorExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/ConstructorExp.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ConstructorExp.java 9 Oct 2004 09:28:41 -0000 1.8 --- ConstructorExp.java 9 Oct 2004 10:25:48 -0000 1.9 *************** *** 29,33 **** this.classType = (ClassType) thisDecl.getType(); thisDecl.context = this; - this.primary = true; } --- 29,32 ---- *************** *** 35,39 **** { this.classType = classType; - this.primary = false; } --- 34,37 ---- *************** *** 46,50 **** private ClassType classType; private Expression superCall; - private boolean primary; ClassType getClassType() { return classType; } --- 44,47 ---- *************** *** 92,97 **** void enterFunction (Compilation comp) { ! if (primary) ! // The super call has to come before anything else. superCall.compile(comp, Target.Ignore); --- 89,94 ---- void enterFunction (Compilation comp) { ! // The super call has to come before anything else. ! if (superCall != null) superCall.compile(comp, Target.Ignore); |
From: Daniel B. <bo...@us...> - 2004-10-09 09:41:43
|
Update of /cvsroot/nice/Nice/testsuite/compiler/classes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20438/testsuite/compiler/classes Modified Files: initializer.testsuite Log Message: Compile initializers in a $init method that is called after all constructors have been executed so that the instance is valid. (This implies that code in proper constructors cannot capture 'this' anymore, hence the simplification of gnu.expr.ConstructorExp) Index: initializer.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/classes/initializer.testsuite,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** initializer.testsuite 8 Oct 2004 17:56:00 -0000 1.16 --- initializer.testsuite 9 Oct 2004 09:41:31 -0000 1.17 *************** *** 56,60 **** } ! /// PASS bug // Initializers should be executed after all the instance variables are set let dummy = new B(); --- 56,60 ---- } ! /// PASS // Initializers should be executed after all the instance variables are set let dummy = new B(); |
From: Daniel B. <bo...@us...> - 2004-10-09 09:29:06
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18206/src/bossa/syntax Modified Files: pattern.nice NiceClass.java DefaultConstructor.java Log Message: Compile initializers in a $init method that is called after all constructors have been executed so that the instance is valid. (This implies that code in proper constructors cannot capture 'this' anymore, hence the simplification of gnu.expr.ConstructorExp) Index: NiceClass.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/NiceClass.java,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** NiceClass.java 7 Oct 2004 15:29:28 -0000 1.86 --- NiceClass.java 9 Oct 2004 09:28:41 -0000 1.87 *************** *** 476,480 **** } ! public int nbInitializers() { return initializers.length; } private void resolveIntitializers() --- 476,480 ---- } ! private int nbInitializers() { return initializers.length; } private void resolveIntitializers() *************** *** 511,522 **** private gnu.expr.Expression thisExp; ! void setThisExp(gnu.expr.Expression thisExp) ! { ! this.thisExp = thisExp; ! } ! gnu.expr.Expression compileInitializer(int index) { ! return initializers[index].generateCode(); } --- 511,556 ---- private gnu.expr.Expression thisExp; ! /** ! Reference to the method performing instance initialization for this class. ! */ ! private gnu.expr.Expression initializer; ! gnu.expr.Expression getInitializer() { ! if (initializer != null) ! return initializer; ! ! gnu.expr.Expression parentInitializer = null; ! NiceClass parent = this.getParent(); ! if (parent != null) ! { ! parentInitializer = parent.getInitializer(); ! } ! ! if (nbInitializers() == 0 && parentInitializer == null) ! return null; ! ! gnu.expr.Expression[] params = new gnu.expr.Expression[1]; ! gnu.expr.LambdaExp lambda = Gen.createMemberMethod ! ("$init", classe.getType(), null, gnu.bytecode.Type.void_type, params); ! thisExp = params[0]; ! ! int nPrefix = parentInitializer == null ? 0 : 1; ! gnu.expr.Expression[] body = new gnu.expr.Expression ! [nPrefix + nbInitializers()]; ! ! // Call the parent initializer if present ! if (parentInitializer != null) ! body[0] = Gen.superCall ! (parentInitializer, new gnu.expr.Expression[]{ thisExp }); ! ! // Compile the initializers of this class ! for (int i = 0; i < nbInitializers(); i++) ! body[nPrefix + i] = initializers[i].generateCode(); ! ! Gen.setMethodBody(lambda, new gnu.expr.BeginExp(body)); ! initializer = addJavaMethod(lambda); ! ! return initializer; } *************** *** 626,632 **** gnu.expr.Expression[] params = new gnu.expr.Expression[1]; gnu.expr.LambdaExp lambda = createJavaMethod("clone", cloneMethod, params); ! Gen.setMethodBody(lambda, ! new gnu.expr.ApplyExp(new gnu.expr.QuoteExp(gnu.expr.PrimProcedure.specialCall(cloneMethod)), params)); ! addJavaMethod(lambda); } --- 660,666 ---- gnu.expr.Expression[] params = new gnu.expr.Expression[1]; gnu.expr.LambdaExp lambda = createJavaMethod("clone", cloneMethod, params); ! Gen.setMethodBody ! (lambda, new gnu.expr.ApplyExp(Gen.superCaller(cloneMethod), params)); ! addJavaMethod(lambda); } *************** *** 1019,1022 **** --- 1053,1070 ---- } + public Definition importMethod(gnu.bytecode.Method method) + { + if (method.isConstructor()) + return ImportedConstructor.load(this, method); + + if (method.getArity() == 0 && method.getName().equals("$init")) + { + initializer = Gen.superCaller(method); + return null; + } + + return null; + } + /**************************************************************** * Misc. Index: pattern.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/pattern.nice,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pattern.nice 7 Oct 2004 22:03:44 -0000 1.5 --- pattern.nice 9 Oct 2004 09:28:41 -0000 1.6 *************** *** 409,413 **** if (p.exactlyAt) ! return nice.tools.code.Gen.isOfClass(parameter, ct); return nice.tools.code.Gen.instanceOfExp(parameter, ct); --- 409,413 ---- if (p.exactlyAt) ! return nice.tools.code.Gen.isOfClass(parameter, ct, true); return nice.tools.code.Gen.instanceOfExp(parameter, ct); Index: DefaultConstructor.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/DefaultConstructor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DefaultConstructor.java 7 Oct 2004 15:29:29 -0000 1.1 --- DefaultConstructor.java 9 Oct 2004 09:28:41 -0000 1.2 *************** *** 180,184 **** MonoSymbol[] fullArgs, boolean omitDefaults) { ! int len = fields.length + classe.nbInitializers(); if (len == 0) --- 180,185 ---- MonoSymbol[] fullArgs, boolean omitDefaults) { ! Expression initializer = classe.getInitializer(); ! int len = fields.length + (initializer == null ? 0 : 1); if (len == 0) *************** *** 204,210 **** } ! classe.setThisExp(thisExp); ! for (int i = 0; i < classe.nbInitializers(); i++) ! body[fields.length + i] = classe.compileInitializer(i); return new BeginExp(body); --- 205,220 ---- } ! if (initializer != null) ! { ! Expression isDirectInstance = ! Gen.isOfClass(thisExp, classe.classe.getType(), false); ! ! body[fields.length] = ! new gnu.expr.IfExp ! (isDirectInstance, ! new gnu.expr.ApplyExp ! (initializer, new Expression[]{ thisExp }), ! QuoteExp.voidExp); ! } return new BeginExp(body); |
From: Daniel B. <bo...@us...> - 2004-10-09 09:29:05
|
Update of /cvsroot/nice/Nice/src/gnu/expr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18206/src/gnu/expr Modified Files: ConstructorExp.java ApplyExp.java Added Files: MemberLambdaExp.java Log Message: Compile initializers in a $init method that is called after all constructors have been executed so that the instance is valid. (This implies that code in proper constructors cannot capture 'this' anymore, hence the simplification of gnu.expr.ConstructorExp) Index: ApplyExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/ApplyExp.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ApplyExp.java 6 Nov 2003 14:30:31 -0000 1.10 --- ApplyExp.java 9 Oct 2004 09:28:41 -0000 1.11 *************** *** 14,17 **** --- 14,20 ---- boolean tailCall; + /** true if this is a special (super) call. */ + boolean special; + /** Containing LambdaExp. */ LambdaExp context; *************** *** 27,31 **** public final void setTailCall(boolean tailCall) { this.tailCall = tailCall; } ! public ApplyExp (Expression f, Expression[] a) { func = f; args = a; } public ApplyExp (Procedure p, Expression[] a) { func = new QuoteExp(p); args = a; } --- 30,37 ---- public final void setTailCall(boolean tailCall) { this.tailCall = tailCall; } ! public ApplyExp (Expression f, Expression[] a) { this(f, a, false); } ! ! public ApplyExp (Expression f, Expression[] a, boolean special) ! { func = f; args = a; this.special = special; } public ApplyExp (Procedure p, Expression[] a) { func = new QuoteExp(p); args = a; } *************** *** 237,241 **** argTypes, varArgs, func_name, func_lambda, comp); ! code.emitInvoke(method); target.compileFromStack(comp, func_lambda.getReturnType()); return; --- 243,250 ---- argTypes, varArgs, func_name, func_lambda, comp); ! if (exp.special) ! code.emitInvokeSpecial(method); ! else ! code.emitInvoke(method); target.compileFromStack(comp, func_lambda.getReturnType()); return; --- NEW FILE: MemberLambdaExp.java --- /**************************************************************************/ /* N I C E */ /* A high-level object-oriented research language */ /* (c) Daniel Bonniot 2004 */ /* */ /* This program is free software; you can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation; either version 2 of the License, or */ /* (at your option) any later version. */ /* */ /**************************************************************************/ package gnu.expr; import gnu.bytecode.*; /** A LambdaExp member of a class (with a this argument). @author Daniel Bonniot (bo...@us...) */ public class MemberLambdaExp extends LambdaExp { public MemberLambdaExp(Declaration thisDecl) { this.thisDecl = thisDecl; thisDecl.context = this; } private Declaration thisDecl; void enterFunction (Compilation comp) { // Do the normal stuff. super.enterFunction(comp); // Save 'this' if it is captured if (thisDecl.field != null) { CodeAttr code = comp.getCode(); thisDecl.loadOwningObject(comp); code.emitPushThis(); code.emitPutField(thisDecl.field); } } } Index: ConstructorExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/ConstructorExp.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ConstructorExp.java 22 Dec 2003 01:30:59 -0000 1.7 --- ConstructorExp.java 9 Oct 2004 09:28:41 -0000 1.8 *************** *** 93,117 **** { if (primary) ! { ! // The super call has to come before anything else. ! superCall.compile(comp, Target.Ignore); ! ! // Do the normal stuff. ! super.enterFunction(comp); ! ! // Save 'this' if it is captured ! if (thisDecl.field != null) ! { ! CodeAttr code = comp.getCode(); ! thisDecl.loadOwningObject(comp); ! code.emitPushThis(); ! code.emitPutField(thisDecl.field); ! } ! } ! else ! { ! // nothing special to do for custom constructors. ! super.enterFunction(comp); ! } } } --- 93,101 ---- { if (primary) ! // The super call has to come before anything else. ! superCall.compile(comp, Target.Ignore); ! ! // Do the normal stuff. ! super.enterFunction(comp); } } |
From: Daniel B. <bo...@us...> - 2004-10-09 09:29:05
|
Update of /cvsroot/nice/Nice/src/bossa/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18206/src/bossa/modules Modified Files: Package.java Log Message: Compile initializers in a $init method that is called after all constructors have been executed so that the instance is valid. (This implies that code in proper constructors cannot capture 'this' anymore, hence the simplification of gnu.expr.ConstructorExp) Index: Package.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/modules/Package.java,v retrieving revision 1.121 retrieving revision 1.122 diff -C2 -d -r1.121 -r1.122 *** Package.java 7 Oct 2004 15:29:31 -0000 1.121 --- Package.java 9 Oct 2004 09:28:42 -0000 1.122 *************** *** 630,634 **** method = method.getNext()) { ! Definition d = ImportedConstructor.load(def, method); if (d != null) definitions.add(d); --- 630,634 ---- method = method.getNext()) { ! Definition d = def.importMethod(method); if (d != null) definitions.add(d); |
From: Daniel B. <bo...@us...> - 2004-10-09 09:28:52
|
Update of /cvsroot/nice/Nice/src/nice/tools/code In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18206/src/nice/tools/code Modified Files: IsOfClassProc.java Gen.java Log Message: Compile initializers in a $init method that is called after all constructors have been executed so that the instance is valid. (This implies that code in proper constructors cannot capture 'this' anymore, hence the simplification of gnu.expr.ConstructorExp) Index: Gen.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/code/Gen.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Gen.java 30 Jun 2004 09:42:34 -0000 1.20 --- Gen.java 9 Oct 2004 09:28:40 -0000 1.21 *************** *** 29,35 **** } ! public static Expression isOfClass(Expression value, Type ct) { ! return Inline.inline(new IsOfClassProc(ct), value); } --- 29,36 ---- } ! public static Expression isOfClass(Expression value, Type ct, ! boolean possiblyNull) { ! return Inline.inline(new IsOfClassProc(ct, possiblyNull), value); } *************** *** 227,231 **** Expression[] params) { ! LambdaExp lexp = new LambdaExp(); bytecodeName = nice.tools.code.Strings.escape(bytecodeName); int arity = 1 + (argTypes == null ? 0 : argTypes.length); --- 228,234 ---- Expression[] params) { ! Declaration thisDecl = new Declaration("this"); ! LambdaExp lexp = new MemberLambdaExp(thisDecl); ! bytecodeName = nice.tools.code.Strings.escape(bytecodeName); int arity = 1 + (argTypes == null ? 0 : argTypes.length); *************** *** 247,252 **** if (isThis) { ! d = new Declaration(parameterName); ! d.context = lexp; d.setType(receiver); params[n] = new ThisExp(d); --- 250,254 ---- if (isThis) { ! d = thisDecl; d.setType(receiver); params[n] = new ThisExp(d); *************** *** 261,266 **** d.setCanRead(true); d.setCanWrite(true); - } return lexp; } --- 263,268 ---- d.setCanRead(true); d.setCanWrite(true); } + return lexp; } *************** *** 350,353 **** lambda.body = new ApplyExp(proc, args); return lambda; ! } } --- 352,366 ---- lambda.body = new ApplyExp(proc, args); return lambda; ! } ! ! public static Expression superCall(Expression method, Expression[] args) ! { ! return new ApplyExp(method, args, true); ! } ! ! ! public static Expression superCaller(Method method) ! { ! return new QuoteExp(PrimProcedure.specialCall(method)); ! } } Index: IsOfClassProc.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/code/IsOfClassProc.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IsOfClassProc.java 24 May 2003 19:55:58 -0000 1.2 --- IsOfClassProc.java 9 Oct 2004 09:28:40 -0000 1.3 *************** *** 19,29 **** public class IsOfClassProc extends Procedure1 implements Inlineable { ! public IsOfClassProc(Type type) { this.type = type; } private Type type; ! public void compile (ApplyExp exp, Compilation comp, Target target) { --- 19,31 ---- public class IsOfClassProc extends Procedure1 implements Inlineable { ! public IsOfClassProc(Type type, boolean possiblyNull) { this.type = type; + this.possiblyNull = possiblyNull; } private Type type; ! private boolean possiblyNull; ! public void compile (ApplyExp exp, Compilation comp, Target target) { *************** *** 31,46 **** CodeAttr code = comp.getCode(); - //first a check is needed for the case that the argument is null args[0].compile(comp, Target.pushObject); ! code.emitDup(); ! code.emitIfNotNull(); code.emitInvokeVirtual(getClassMethod); code.emitInvokeVirtual(getNameMethod); code.emitPushString(type.getName()); code.emitInvokeVirtual(equalsMethod); ! code.emitElse(); ! code.emitPop(1); ! code.emitPushBoolean(false); ! code.emitFi(); target.compileFromStack(comp, Type.boolean_type); } --- 33,58 ---- CodeAttr code = comp.getCode(); args[0].compile(comp, Target.pushObject); ! ! if (possiblyNull) ! { ! //first a check is needed for the case that the argument is null ! code.emitDup(); ! code.emitIfNotNull(); ! } ! code.emitInvokeVirtual(getClassMethod); code.emitInvokeVirtual(getNameMethod); code.emitPushString(type.getName()); code.emitInvokeVirtual(equalsMethod); ! ! if (possiblyNull) ! { ! code.emitElse(); ! code.emitPop(1); ! code.emitPushBoolean(false); ! code.emitFi(); ! } ! target.compileFromStack(comp, Type.boolean_type); } |
From: Daniel B. <bo...@us...> - 2004-10-08 17:56:10
|
Update of /cvsroot/nice/Nice/testsuite/compiler/classes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31174/testsuite/compiler/classes Modified Files: initializer.testsuite Log Message: Test initializers with subclassing in a different package, and that initializers are only executed once. Index: initializer.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/classes/initializer.testsuite,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** initializer.testsuite 11 Jun 2004 05:01:39 -0000 1.15 --- initializer.testsuite 8 Oct 2004 17:56:00 -0000 1.16 *************** *** 4,13 **** let int cst = 42; ! class A { int i; ! { ! int j = i; assert j == cst; } --- 4,13 ---- let int cst = 42; ! class A { int i; ! { ! int j = i; assert j == cst; } *************** *** 16,20 **** /// FAIL /// Toplevel ! class A { int i; --- 16,20 ---- /// FAIL /// Toplevel ! class A { int i; *************** *** 31,35 **** /// Toplevel ! class A { { throw new Error(); } --- 31,35 ---- /// Toplevel ! class A { { throw new Error(); } *************** *** 47,51 **** /// Toplevel ! class A { { throw new Error(); } --- 47,51 ---- /// Toplevel ! class A { { throw new Error(); } *************** *** 61,65 **** /// Toplevel ! class A { void foo(); --- 61,65 ---- /// Toplevel ! class A { void foo(); *************** *** 90,94 **** void doTest() {} } ! class test2 { {this.doTest2();} --- 90,94 ---- void doTest() {} } ! class test2 { {this.doTest2();} *************** *** 113,120 **** { boolean initialised = false; ! { let b1 = true, b2 = true; if (b1 && b2) ! initialised = true; } } --- 113,120 ---- { boolean initialised = false; ! { let b1 = true, b2 = true; if (b1 && b2) ! initialised = true; } } *************** *** 179,183 **** this.foo((String s) => {}); } ! void foo(String->void f) { (f)("xyz"); --- 179,183 ---- this.foo((String s) => {}); } ! void foo(String->void f) { (f)("xyz"); *************** *** 191,199 **** let dummy = new TestA(a: "ABC").b.equals("ABC"); /// Toplevel ! class TestA { String a; String b = ""; ! { let f = (String l) => this; b = f("").a; --- 191,199 ---- let dummy = new TestA(a: "ABC").b.equals("ABC"); /// Toplevel ! class TestA { String a; String b = ""; ! { let f = (String l) => this; b = f("").a; *************** *** 217,218 **** --- 217,253 ---- void fst(int i) {} + + /// PASS + // Test subclassing in a different package + /// package a + /// Toplevel + class A { + boolean a = false; + { a = true; } + } + + /// package b import a + let b = new B(); + assert b.a && b.b; + /// Toplevel + class B extends A { + boolean b = false; + + { b = true; } + } + + /// PASS + let a = new A("foo"); + // Check that the initializer has been executed only once + assert a.i == 4; + /// Toplevel + class A + { + int i = 0; + + { + i++; + } + } + + new A(String s) { this(i: s.length); } |
From: Daniel B. <bo...@us...> - 2004-10-08 06:08:28
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30462/src/bossa/parser Modified Files: Parser.jj Log Message: Reenable '0f' syntax for single precision zero floating point number. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.266 retrieving revision 1.267 diff -C2 -d -r1.266 -r1.267 *** Parser.jj 22 Sep 2004 21:10:48 -0000 1.266 --- Parser.jj 6 Oct 2004 16:14:02 -0000 1.267 *************** *** 278,283 **** ["0"-"9"] (["0"-"9", "_"])* "." (["0"-"9", "_"])+ (<EXPONENT>)? (["f","F","d","D"])? | "." ["0"-"9"] (["0"-"9", "_"])* (<EXPONENT>)? (["f","F","d","D"])? ! | ["1"-"9"] (["0"-"9", "_"])* <EXPONENT> (["f","F","d","D"])? ! | ["1"-"9"] (["0"-"9", "_"])* (<EXPONENT>)? ["f","F","d","D"] > | --- 278,283 ---- ["0"-"9"] (["0"-"9", "_"])* "." (["0"-"9", "_"])+ (<EXPONENT>)? (["f","F","d","D"])? | "." ["0"-"9"] (["0"-"9", "_"])* (<EXPONENT>)? (["f","F","d","D"])? ! | ["0"-"9"] (["0"-"9", "_"])* <EXPONENT> (["f","F","d","D"])? ! | ["0"-"9"] (["0"-"9", "_"])* (<EXPONENT>)? ["f","F","d","D"] > | |