nice-commit Mailing List for The Nice Programming Language (Page 11)
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...> - 2005-03-28 11:35:22
|
Update of /cvsroot/nice/Nice/stdlib/nice/io In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1516/stdlib/nice/io Modified Files: file.nice Log Message: Enforce private visibility for methods (no restriction yet). Index: file.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/io/file.nice,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** file.nice 4 Mar 2005 21:36:09 -0000 1.3 --- file.nice 28 Mar 2005 11:35:14 -0000 1.4 *************** *** 60,64 **** //Java doesn't do tail call elimination... let stack = new Stack(); ! var list = dir.listDir(filter).toArrayList(); list.sort(sortBy); var current = list.iterator(); --- 60,64 ---- //Java doesn't do tail call elimination... let stack = new Stack(); ! var list = Arrays.asList(dir.listDir(filter)); list.sort(sortBy); var current = list.iterator(); *************** *** 74,78 **** if (f.isDirectory()) { stack.push(current); ! list = f.listDir(filter).toArrayList(); list.sort(sortBy); current = list.iterator(); --- 74,78 ---- if (f.isDirectory()) { stack.push(current); ! list = Arrays.asList(f.listDir(filter)); list.sort(sortBy); current = list.iterator(); |
From: Daniel B. <bo...@us...> - 2005-03-26 15:33:11
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11173 Modified Files: NEWS Log Message: Exit the JVM with exit code 1 when the main program finishes with an uncaught exception. Index: NEWS =================================================================== RCS file: /cvsroot/nice/Nice/NEWS,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** NEWS 24 Mar 2005 14:47:08 -0000 1.73 --- NEWS 26 Mar 2005 15:33:02 -0000 1.74 *************** *** 47,50 **** --- 47,52 ---- Nice classes, so that those do not need to be automatically added to generated jars. + * Exit the JVM with exit code 1 when the main program finishes with an + uncaught exception. * Bug fixes (negative int hex literals, ...) |
From: Daniel B. <bo...@us...> - 2005-03-26 15:33:10
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11173/src/bossa/syntax Modified Files: compilation.nice Log Message: Exit the JVM with exit code 1 when the main program finishes with an uncaught exception. Index: compilation.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/compilation.nice,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** compilation.nice 25 Mar 2005 16:40:00 -0000 1.7 --- compilation.nice 26 Mar 2005 15:33:02 -0000 1.8 *************** *** 84,95 **** res.setCatchClauses(c); ! gnu.bytecode.Method print = gnu.bytecode.ClassType.make("nice.lang.dispatch"). ! addMethod("printStackTraceWithSourceInfo", gnu.bytecode.Access.PUBLIC | gnu.bytecode.Access.STATIC, [cast(gnu.bytecode.Type.throwable_type)], gnu.bytecode.Type.void_type); ! c.setBody(new gnu.expr.ApplyExp(new gnu.expr.PrimProcedure(print), ! [new gnu.expr.ReferenceExp(c.getDeclaration())])); return res; --- 84,102 ---- res.setCatchClauses(c); ! let print = gnu.bytecode.ClassType.make("nice.lang.dispatch"). ! addMethod("printStackTraceWithSourceInfo", gnu.bytecode.Access.PUBLIC | gnu.bytecode.Access.STATIC, [cast(gnu.bytecode.Type.throwable_type)], gnu.bytecode.Type.void_type); ! let exit = gnu.bytecode.ClassType.make("java.lang.System"). ! getDeclaredMethod("exit", 1); ! ! c.setBody(new gnu.expr.BeginExp ! ([new gnu.expr.ApplyExp(print, ! [new gnu.expr.ReferenceExp(c.getDeclaration())]), ! new gnu.expr.ApplyExp(exit, ! [new gnu.expr.QuoteExp(new Integer(1))]) ! ])); return res; |
From: Daniel B. <bo...@us...> - 2005-03-26 11:31:44
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32267/stdlib/nice/lang Modified Files: source-lines.nice Log Message: Allow to disable beautification of stack traces, as a last resort when beautification (or the JVM) is buggy. Index: source-lines.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/source-lines.nice,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** source-lines.nice 24 Feb 2005 16:38:23 -0000 1.8 --- source-lines.nice 26 Mar 2005 11:31:30 -0000 1.9 *************** *** 21,24 **** --- 21,26 ---- import java.io.*; + let boolean rawTraces = "true".equals(System.getProperty("nice.raw-traces")); + public <!T, R> R call__(T obj, String methodName) { *************** *** 44,47 **** --- 46,55 ---- ?ClassLoader loader) { + if (rawTraces) + { + t.printStackTrace(w); + return; + } + w.println("Exception in thread \"" Thread.currentThread().getName "\" " t); try { |
From: Daniel B. <bo...@us...> - 2005-03-26 02:11:48
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11746/src/bossa/syntax Modified Files: enum.nice Log Message: Locate enum field type errors. Index: enum.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/enum.nice,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** enum.nice 25 Mar 2005 16:40:00 -0000 1.21 --- enum.nice 26 Mar 2005 02:11:34 -0000 1.22 *************** *** 185,189 **** args.add(new Argument(value: argExps[i], name: fields[i].getName())); ! return new EnumSymbol(name, syntacticType: type, definition: def, value: ! createNewExp(new TypeIdent(name: enumName), new Arguments(arguments: args))); } --- 185,191 ---- args.add(new Argument(value: argExps[i], name: fields[i].getName())); ! let value = createNewExp(new TypeIdent(name: enumName), new Arguments(arguments: args)); ! value.setLocation(name.location); ! ! return new EnumSymbol(name, syntacticType: type, definition: def, value: value); } |
From: Daniel B. <bo...@us...> - 2005-03-26 02:11:43
|
Update of /cvsroot/nice/Nice/testsuite/compiler/enums In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11746/testsuite/compiler/enums Added Files: fields.testsuite Log Message: Locate enum field type errors. --- NEW FILE: fields.testsuite --- /// FAIL /// Toplevel enum Modifier(int bit) { PUBLIC(0), /*/// FAIL HERE */ PRIVATE("") } |
From: Arjan B. <ar...@us...> - 2005-03-26 00:48:17
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27487/F:/nice/src/bossa/syntax Modified Files: customConstructor.nice scope.nice tools.nice Log Message: Maybe null return types for typescope lookups. Index: tools.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/tools.nice,v retrieving revision 1.108 retrieving revision 1.109 diff -C2 -d -r1.108 -r1.109 *** tools.nice 25 Mar 2005 16:40:00 -0000 1.108 --- tools.nice 26 Mar 2005 00:48:09 -0000 1.109 *************** *** 189,192 **** --- 189,196 ---- List<VarSymbol> lookup(VarScope, LocatedString) = native List VarScope.lookup(LocatedString); List<VarSymbol> globalLookup(VarScope, LocatedString) = native List VarScope.globalLookup(LocatedString); + ?mlsub.typing.TypeConstructor globalLookup(TypeScope, String, ?Location) = native mlsub.typing.TypeConstructor TypeScope.globalLookup(String, Location); + ?mlsub.typing.TypeSymbol lookup(TypeScope, String, ?Location) = native mlsub.typing.TypeSymbol TypeScope.lookup(String, Location); + ?mlsub.typing.TypeSymbol lookup(TypeScope, String) = native mlsub.typing.TypeSymbol TypeScope.lookup(String); + ?mlsub.typing.TypeSymbol lookup(TypeScope, LocatedString) = native mlsub.typing.TypeSymbol TypeScope.lookup(LocatedString); Map<gnu.bytecode.Type,mlsub.typing.TypeConstructor> javaTypeConstructors(bossa.modules.Compilation ) = native bossa.modules.Compilation.javaTypeConstructors; Scope<VarSymbol> javaScope(bossa.modules.Compilation) = native bossa.modules.Compilation.javaScope; Index: customConstructor.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/customConstructor.nice,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** customConstructor.nice 6 Mar 2005 01:34:26 -0000 1.24 --- customConstructor.nice 26 Mar 2005 00:48:09 -0000 1.25 *************** *** 43,47 **** super; ! let tc = Node.getGlobalTypeScope().globalLookup(className); addConstructor(tc, this); classe = getNiceClass(tc); --- 43,47 ---- super; ! let tc = notNull(Node.getGlobalTypeScope().globalLookup(className)); addConstructor(tc, this); classe = getNiceClass(tc); Index: scope.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/scope.nice,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** scope.nice 25 Mar 2005 16:40:00 -0000 1.8 --- scope.nice 26 Mar 2005 00:48:09 -0000 1.9 *************** *** 78,82 **** } ! public mlsub.typing.TypeConstructor globalLookup(LocatedString name) { return this.globalLookup(name.toString(), name.location()); --- 78,82 ---- } ! public ?mlsub.typing.TypeConstructor globalLookup(LocatedString name) { return this.globalLookup(name.toString(), name.location()); *************** *** 85,94 **** globalLookup(name, loc) { ! mlsub.typing.TypeSymbol res = this.lookup(name, loc); if (res instanceof mlsub.typing.TypeConstructor) return res; ! return cast(null); } --- 85,97 ---- globalLookup(name, loc) { ! let res = this.lookup(name, loc); if (res instanceof mlsub.typing.TypeConstructor) return res; ! if (res != null) ! Internal.warning("Non type-constructor found in global type scope"); ! ! return null; } |
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15663/F:/nice/src/bossa/syntax Modified Files: alternative.nice block.nice compilation.nice constant.nice constructor.nice defaultconstructor.nice dispatchTest.nice enum.nice exceptions.nice formalParameters.nice globalvar.nice importedconstructor.nice inline.nice javaclass.nice javaFieldAccess.nice javaMethod.nice methodbody.nice monotype.nice niceclass.nice niceMethod.nice pattern.nice return.nice scope.nice super.nice symbol.nice tools.nice tuple.nice typecheck.nice typeConstructors.nice typedef.nice typeIdent.nice Log Message: Nullness cleanup. Index: typeIdent.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typeIdent.nice,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** typeIdent.nice 16 Jan 2005 00:28:21 -0000 1.6 --- typeIdent.nice 25 Mar 2005 16:40:00 -0000 1.7 *************** *** 37,41 **** public mlsub.typing.TypeSymbol resolveToTypeSymbol(TypeMap scope) { ! let res = notNull(scope).lookup(name); if (res == null) throw unknownIdent(name); --- 37,41 ---- public mlsub.typing.TypeSymbol resolveToTypeSymbol(TypeMap scope) { ! let res = scope.lookup(name); if (res == null) throw unknownIdent(name); Index: block.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/block.nice,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** block.nice 22 Feb 2005 10:27:09 -0000 1.5 --- block.nice 25 Mar 2005 16:40:00 -0000 1.6 *************** *** 104,108 **** } ! return this.addLocals(locals.iterator(), notNull(gnu.expr.QuoteExp.voidExp)); } --- 104,108 ---- } ! return this.addLocals(locals.iterator(), gnu.expr.QuoteExp.voidExp); } Index: scope.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/scope.nice,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** scope.nice 12 Mar 2005 02:41:47 -0000 1.7 --- scope.nice 25 Mar 2005 16:40:00 -0000 1.8 *************** *** 90,96 **** return res; - if (res != null) - Internal.warning("Non type-constructor found in global type scope"); - return cast(null); } --- 90,93 ---- Index: return.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/return.nice,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** return.nice 7 Mar 2005 17:10:51 -0000 1.5 --- return.nice 25 Mar 2005 16:40:00 -0000 1.6 *************** *** 49,53 **** generateCode() { ! return notNull(nice.tools.code.Gen.returnVoid()); } --- 49,53 ---- generateCode() { ! return nice.tools.code.Gen.returnVoid(); } Index: tuple.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/tuple.nice,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tuple.nice 16 Jan 2005 00:28:21 -0000 1.6 --- tuple.nice 25 Mar 2005 16:40:00 -0000 1.7 *************** *** 150,154 **** { letExp = new gnu.expr.LetExp([array]); ! let tupleDecl = notNull(letExp).addDeclaration("tupleRef", arrayType); //FIXME: CanRead should be set automatically. --- 150,154 ---- { letExp = new gnu.expr.LetExp([array]); ! let tupleDecl = letExp.addDeclaration("tupleRef", arrayType); //FIXME: CanRead should be set automatically. Index: compilation.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/compilation.nice,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** compilation.nice 14 Jan 2005 22:47:11 -0000 1.6 --- compilation.nice 25 Mar 2005 16:40:00 -0000 1.7 *************** *** 19,24 **** */ ! let gnu.bytecode.Method newError = notNull(gnu.bytecode.ClassType. ! make("java.lang.Error")).getDeclaredMethod("<init>", [cast(gnu.bytecode.Type.string_type)]); --- 19,24 ---- */ ! let gnu.bytecode.Method newError = gnu.bytecode.ClassType. ! make("java.lang.Error").getDeclaredMethod("<init>", [cast(gnu.bytecode.Type.string_type)]); Index: niceclass.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/niceclass.nice,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** niceclass.nice 13 Mar 2005 05:53:46 -0000 1.27 --- niceclass.nice 25 Mar 2005 16:40:00 -0000 1.28 *************** *** 455,459 **** let sym = asTypeSymbol(typeParameters[i]); scope.addMapping(ourSym.toString(), sym); ! notNull(map).put(ourSym, sym); } catch(TypeScope.DuplicateName e) {} } --- 455,459 ---- let sym = asTypeSymbol(typeParameters[i]); scope.addMapping(ourSym.toString(), sym); ! map.put(ourSym, sym); } catch(TypeScope.DuplicateName e) {} } Index: typecheck.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v retrieving revision 1.129 retrieving revision 1.130 diff -C2 -d -r1.129 -r1.130 *** typecheck.nice 8 Mar 2005 19:33:19 -0000 1.129 --- typecheck.nice 25 Mar 2005 16:40:00 -0000 1.130 *************** *** 295,301 **** { ?List<MonoSymbol> notNullIfFalse0 = ! second_(nullnessInfo(notNull(test.arguments.getExp(0)))); ?List<MonoSymbol> notNullIfFalse1 = ! second_(nullnessInfo(notNull(test.arguments.getExp(1)))); // If this test is false, it is because both subtests are. --- 295,301 ---- { ?List<MonoSymbol> notNullIfFalse0 = ! second_(nullnessInfo(test.arguments.getExp(0))); ?List<MonoSymbol> notNullIfFalse1 = ! second_(nullnessInfo(test.arguments.getExp(1))); // If this test is false, it is because both subtests are. *************** *** 306,312 **** { ?List<MonoSymbol> notNullIfTrue0 = ! first_(nullnessInfo(notNull(test.arguments.getExp(0)))); ?List<MonoSymbol> notNullIfTrue1 = ! first_(nullnessInfo(notNull(test.arguments.getExp(1)))); // If this test is true, it is because both subtests are. --- 306,312 ---- { ?List<MonoSymbol> notNullIfTrue0 = ! first_(nullnessInfo(test.arguments.getExp(0))); ?List<MonoSymbol> notNullIfTrue1 = ! first_(nullnessInfo(test.arguments.getExp(1))); // If this test is true, it is because both subtests are. *************** *** 323,334 **** int varPosition; ! if (isNull(notNull(test.arguments.getExp(0)))) varPosition = 1; ! else if (isNull(notNull(test.arguments.getExp(1)))) varPosition = 0; else // Give up. return (null, null); ! ?MonoSymbol variable = localVariable(notNull(test.arguments.getExp(varPosition))); if (variable == null) return (null, null); --- 323,334 ---- int varPosition; ! if (isNull(test.arguments.getExp(0))) varPosition = 1; ! else if (isNull(test.arguments.getExp(1))) varPosition = 0; else // Give up. return (null, null); ! ?MonoSymbol variable = localVariable(test.arguments.getExp(varPosition)); if (variable == null) return (null, null); *************** *** 379,385 **** { ?List<(MonoSymbol, mlsub.typing.Monotype)> instanceofIfFalse0 = ! second_(instanceofInfo(notNull(test.arguments.getExp(0)))); ?List<(MonoSymbol, mlsub.typing.Monotype)> instanceofIfFalse1 = ! second_(instanceofInfo(notNull(test.arguments.getExp(1)))); return (null, combine(instanceofIfFalse0, instanceofIfFalse1)); --- 379,385 ---- { ?List<(MonoSymbol, mlsub.typing.Monotype)> instanceofIfFalse0 = ! second_(instanceofInfo(test.arguments.getExp(0))); ?List<(MonoSymbol, mlsub.typing.Monotype)> instanceofIfFalse1 = ! second_(instanceofInfo(test.arguments.getExp(1))); return (null, combine(instanceofIfFalse0, instanceofIfFalse1)); *************** *** 389,395 **** { ?List<(MonoSymbol, mlsub.typing.Monotype)> instanceofIfTrue0 = ! first_(instanceofInfo(notNull(test.arguments.getExp(0)))); ?List<(MonoSymbol, mlsub.typing.Monotype)> instanceofIfTrue1 = ! first_(instanceofInfo(notNull(test.arguments.getExp(1)))); return (combine(instanceofIfTrue0, instanceofIfTrue1), null); --- 389,395 ---- { ?List<(MonoSymbol, mlsub.typing.Monotype)> instanceofIfTrue0 = ! first_(instanceofInfo(test.arguments.getExp(0))); ?List<(MonoSymbol, mlsub.typing.Monotype)> instanceofIfTrue1 = ! first_(instanceofInfo(test.arguments.getExp(1))); return (combine(instanceofIfTrue0, instanceofIfTrue1), null); *************** *** 400,404 **** (?List<(MonoSymbol, mlsub.typing.Monotype)> ifTrue, ?List<(MonoSymbol, mlsub.typing.Monotype)> ifFalse) = ! instanceofInfo(notNull(test.arguments.getExp(0))); return (ifFalse, ifTrue); } --- 400,404 ---- (?List<(MonoSymbol, mlsub.typing.Monotype)> ifTrue, ?List<(MonoSymbol, mlsub.typing.Monotype)> ifFalse) = ! instanceofInfo(test.arguments.getExp(0)); return (ifFalse, ifTrue); } *************** *** 916,920 **** ?List<(MonoSymbol, mlsub.typing.Monotype)> instanceofIfTrue = ! first_(instanceofInfo(notNull(whileExp))); if (instanceofIfTrue != null) --- 916,920 ---- ?List<(MonoSymbol, mlsub.typing.Monotype)> instanceofIfTrue = ! first_(instanceofInfo(whileExp)); if (instanceofIfTrue != null) *************** *** 963,969 **** } catch(WrongReturnType e){ ! if (notNullError(notNull(e.typingException), r, String.valueOf(r.value))) wrongReturnType(r, r.returnType().toString(), ! valueOf(e.expectedReturnType), notNull(e.typingException)); } catch(IncompatibleReturnType e){ --- 963,969 ---- } catch(WrongReturnType e){ ! if (notNullError(e.typingException, r, String.valueOf(r.value))) wrongReturnType(r, r.returnType().toString(), ! valueOf(e.expectedReturnType), e.typingException); } catch(IncompatibleReturnType e){ *************** *** 986,990 **** catch(WrongReturnType e){ wrongReturnType(r, r.returnType().toString(), ! valueOf(e.expectedReturnType), notNull(e.typingException)); } catch(IncompatibleReturnType e){ --- 986,990 ---- catch(WrongReturnType e){ wrongReturnType(r, r.returnType().toString(), ! valueOf(e.expectedReturnType), e.typingException); } catch(IncompatibleReturnType e){ *************** *** 1062,1067 **** to keep track of the lowlevel exception. */ ! let tc1 = notNull(ex.getM1()).head(); ! let tc2 = notNull(ex.getM2()).head(); if (tc1 == tc2) return false; --- 1062,1067 ---- to keep track of the lowlevel exception. */ ! let tc1 = ex.getM1().head(); ! let tc2 = ex.getM2().head(); if (tc1 == tc2) return false; Index: tools.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/tools.nice,v retrieving revision 1.107 retrieving revision 1.108 diff -C2 -d -r1.107 -r1.108 *** tools.nice 11 Mar 2005 17:35:52 -0000 1.107 --- tools.nice 25 Mar 2005 16:40:00 -0000 1.108 *************** *** 51,58 **** mlsub.typing.Monotype makeSure(mlsub.typing.Monotype m) = ! notNull(sureMonotype(nice.tools.typing.Types.rawType(m))); mlsub.typing.Monotype makeUnsure(mlsub.typing.Monotype m) = ! notNull(maybeMonotype(nice.tools.typing.Types.rawType(m))); mlsub.typing.Monotype sureMonotype(?mlsub.typing.Monotype type) = --- 51,58 ---- mlsub.typing.Monotype makeSure(mlsub.typing.Monotype m) = ! sureMonotype(nice.tools.typing.Types.rawType(m)); mlsub.typing.Monotype makeUnsure(mlsub.typing.Monotype m) = ! maybeMonotype(nice.tools.typing.Types.rawType(m)); mlsub.typing.Monotype sureMonotype(?mlsub.typing.Monotype type) = Index: niceMethod.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/niceMethod.nice,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** niceMethod.nice 8 Mar 2005 16:03:28 -0000 1.24 --- niceMethod.nice 25 Mar 2005 16:40:00 -0000 1.25 *************** *** 283,287 **** { itf = cast(container); ! tc = notNull(itf).associatedTC(); } --- 283,287 ---- { itf = cast(container); ! tc = itf.associatedTC(); } Index: pattern.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/pattern.nice,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** pattern.nice 25 Mar 2005 13:46:59 -0000 1.22 --- pattern.nice 25 Mar 2005 16:40:00 -0000 1.23 *************** *** 248,252 **** { if (ti.toString().equals("Object")) ! return new NotNullPattern(name: name, tc: nice.tools.typing.PrimitiveType.sureTC, loc: notNull(name.location)); return new TypePattern(name: name, typeConstructor: ti, loc: name.location(), exactlyAt: false); --- 248,252 ---- { if (ti.toString().equals("Object")) ! return new NotNullPattern(name: name, tc: nice.tools.typing.PrimitiveType.sureTC, loc: name.location); return new TypePattern(name: name, typeConstructor: ti, loc: name.location(), exactlyAt: false); Index: javaFieldAccess.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/javaFieldAccess.nice,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** javaFieldAccess.nice 6 Mar 2005 01:34:26 -0000 1.7 --- javaFieldAccess.nice 25 Mar 2005 16:40:00 -0000 1.8 *************** *** 75,81 **** { c = type; ! assert c != null; // Typechecker limitation ! // remembers the fully qualified name ! className.content = c.getName(); for (?gnu.bytecode.Field f = c.getFields(); f != null; f = f.getNext()) --- 75,80 ---- { c = type; ! // remembers the fully qualified name ! className.content = c.getName(); for (?gnu.bytecode.Field f = c.getFields(); f != null; f = f.getNext()) Index: alternative.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/alternative.nice,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** alternative.nice 6 Mar 2005 01:34:26 -0000 1.11 --- alternative.nice 25 Mar 2005 16:39:59 -0000 1.12 *************** *** 127,135 **** // XXX change to LinkedList l = new ArrayList(); ! alternativesMap.put(fullName,notNull(l)); } // Dispatch.sort(final List alternatives) assumes that new alternatives // are added at the end ! notNull(l).add(this); } --- 127,135 ---- // XXX change to LinkedList l = new ArrayList(); ! alternativesMap.put(fullName, l); } // Dispatch.sort(final List alternatives) assumes that new alternatives // are added at the end ! l.add(this); } *************** *** 151,157 **** { newPatterns = cast(new Pattern[patterns.length]); ! System.arraycopy(patterns, 0, notNull(newPatterns), 0, i); } ! notNull(newPatterns)[i] = createPattern (patterns[i].getName(), nice.tools.typing.Types.concreteConstructor(notNull(parameters)[i]), --- 151,157 ---- { newPatterns = cast(new Pattern[patterns.length]); ! System.arraycopy(patterns, 0, newPatterns, 0, i); } ! newPatterns[i] = createPattern (patterns[i].getName(), nice.tools.typing.Types.concreteConstructor(notNull(parameters)[i]), Index: formalParameters.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/formalParameters.nice,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** formalParameters.nice 13 Mar 2005 03:24:05 -0000 1.9 --- formalParameters.nice 25 Mar 2005 16:40:00 -0000 1.10 *************** *** 204,208 **** if (res == null) res = cast(new java.util.Stack[this.size()]); ! notNull(res)[i] = notNull(notNull(param.symbol).copies); } } --- 204,208 ---- if (res == null) res = cast(new java.util.Stack[this.size()]); ! res[i] = notNull(notNull(param.symbol).copies); } } Index: exceptions.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/exceptions.nice,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** exceptions.nice 16 Jan 2005 00:28:21 -0000 1.11 --- exceptions.nice 25 Mar 2005 16:40:00 -0000 1.12 *************** *** 41,45 **** StringBuffer msg = new StringBuffer(100); msg.append("Incorrect type in assignment to ").append(target); ! msg.append("\nFound : ").append(notNull(value.getType()).toString()); msg.append("\nExpected: ").append(targetType); return new bossa.util.UserError(responsible, msg.toString()); --- 41,45 ---- StringBuffer msg = new StringBuffer(100); msg.append("Incorrect type in assignment to ").append(target); ! msg.append("\nFound : ").append(value.getType().toString()); msg.append("\nExpected: ").append(targetType); return new bossa.util.UserError(responsible, msg.toString()); Index: constructor.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/constructor.nice,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** constructor.nice 16 Jan 2005 21:51:15 -0000 1.9 --- constructor.nice 25 Mar 2005 16:40:00 -0000 1.10 *************** *** 56,60 **** //No such field ! List<String> nonmatching = notNull(arguments).noMatchByName(notNull(parameters)); if (!nonmatching.isEmpty()) { --- 56,60 ---- //No such field ! List<String> nonmatching = arguments.noMatchByName(parameters); if (!nonmatching.isEmpty()) { *************** *** 67,74 **** //an explanation of the syntax is necessary res = new StringBuffer(); ! List<Parameter> missing = notNull(arguments).missingArgs(notNull(parameters)); List<Parameter> fieldsToList; ! if (notNull(arguments).size() == 0) { res.append("Fields of class ").append(name) --- 67,74 ---- //an explanation of the syntax is necessary res = new StringBuffer(); ! List<Parameter> missing = arguments.missingArgs(notNull(parameters)); List<Parameter> fieldsToList; ! if (arguments.size() == 0) { res.append("Fields of class ").append(name) Index: methodbody.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/methodbody.nice,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** methodbody.nice 13 Mar 2005 03:08:13 -0000 1.15 --- methodbody.nice 25 Mar 2005 16:40:00 -0000 1.16 *************** *** 53,57 **** d.registerForDispatch(); if (isInterfaceTC(notNull(formals[0].tc))) ! User.error(this, notNull(name) + " is a native method. Dispatch can only occur if the first argument is not an interface."); } else if (! (d instanceof NiceMethod)) --- 53,57 ---- d.registerForDispatch(); if (isInterfaceTC(notNull(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)) *************** *** 471,475 **** } ! toString() = notNull(name) + "(" + Util.map("", ", ", "", formals) + ")"; } --- 471,475 ---- } ! toString() = name + "(" + Util.map("", ", ", "", formals) + ")"; } Index: dispatchTest.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/dispatchTest.nice,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** dispatchTest.nice 24 Mar 2005 22:36:46 -0000 1.10 --- dispatchTest.nice 25 Mar 2005 16:40:00 -0000 1.11 *************** *** 172,181 **** for (a : alternatives) { ! if (len != notNull(a.patterns).length) Internal.error("Expected number of patterns is " + len + ".\nThe incorrect alternative: " + a); for (int i = 0; i < len; i++) ! if (! notNull(a.patterns)[i].atAny()) res[2*i] = res[2*i + 1] = true; } --- 172,181 ---- for (a : alternatives) { ! if (len != a.patterns.length) Internal.error("Expected number of patterns is " + len + ".\nThe incorrect alternative: " + a); for (int i = 0; i < len; i++) ! if (! a.patterns[i].atAny()) res[2*i] = res[2*i + 1] = true; } Index: enum.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/enum.nice,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** enum.nice 7 Mar 2005 17:10:51 -0000 1.20 --- enum.nice 25 Mar 2005 16:40:00 -0000 1.21 *************** *** 133,137 **** { res = new gnu.expr.Declaration(notNull(name).toString(), nice.tools.code.Types.javaType(type)); ! this.setDeclaration(notNull(res)); definition.module.pkg.addGlobalVar(res, true); } --- 133,137 ---- { res = new gnu.expr.Declaration(notNull(name).toString(), nice.tools.code.Types.javaType(type)); ! this.setDeclaration(res); definition.module.pkg.addGlobalVar(res, true); } Index: inline.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/inline.nice,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** inline.nice 6 Mar 2005 01:34:26 -0000 1.5 --- inline.nice 25 Mar 2005 16:40:00 -0000 1.6 *************** *** 57,61 **** try{ m = notNull(refClass).getMethod("create", [String.class]); ! if (! java.lang.reflect.Modifier.isStatic(notNull(m).getModifiers())) throw new NoSuchMethodException(); } --- 57,61 ---- try{ m = notNull(refClass).getMethod("create", [String.class]); ! if (! java.lang.reflect.Modifier.isStatic(m.getModifiers())) throw new NoSuchMethodException(); } Index: typedef.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typedef.nice,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** typedef.nice 22 Mar 2005 15:32:16 -0000 1.22 --- typedef.nice 25 Mar 2005 16:40:00 -0000 1.23 *************** *** 111,115 **** void createTC() { ! String name = notNull(this.name).toString(); if (name.equals("nice.lang.Array")) --- 111,115 ---- void createTC() { ! String name = this.name.toString(); if (name.equals("nice.lang.Array")) *************** *** 301,305 **** for (MonotypeConstructor parent : names) { ! this.useInheritanceParams(this.resolveParams(parent, notNull(this.getLocalScope()))); let name = notNull(parent.tc); --- 301,305 ---- for (MonotypeConstructor parent : names) { ! this.useInheritanceParams(this.resolveParams(parent, this.getLocalScope())); let name = notNull(parent.tc); *************** *** 319,323 **** javaInterfaces = new ArrayList(5); ! notNull(javaInterfaces).add(s); } else --- 319,323 ---- javaInterfaces = new ArrayList(5); ! javaInterfaces.add(s); } else *************** *** 479,483 **** this.useInheritanceParams(this.resolveParams(s, this.getLocalScope())); let superClass = notNull(s.tc).resolveToTC(notNull(typeScope)); ! let name = notNull(this.name); this.superClass = superClass; --- 479,483 ---- this.useInheritanceParams(this.resolveParams(s, this.getLocalScope())); let superClass = notNull(s.tc).resolveToTC(notNull(typeScope)); ! let name = this.name; this.superClass = superClass; *************** *** 877,881 **** // Assume non-variance ! return notNull(parent.parameters).content.length; } --- 877,881 ---- // Assume non-variance ! return parent.parameters.content.length; } Index: constant.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/constant.nice,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** constant.nice 21 Mar 2005 17:37:41 -0000 1.18 --- constant.nice 25 Mar 2005 16:40:00 -0000 1.19 *************** *** 498,502 **** ?mlsub.typing.TypeConstructor getTC() { ! return notNull(nice.tools.typing.Types.rawType(representedType)).head(); } --- 498,502 ---- ?mlsub.typing.TypeConstructor getTC() { ! return nice.tools.typing.Types.rawType(representedType).head(); } *************** *** 522,526 **** String fullName = name.toString(); if (root != null) ! fullName =notNull(root.name).append(".").append(fullName).toString(); ?mlsub.typing.TypeConstructor tc = --- 522,526 ---- String fullName = name.toString(); if (root != null) ! fullName = root.name.append(".").append(fullName).toString(); ?mlsub.typing.TypeConstructor tc = Index: defaultconstructor.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/defaultconstructor.nice,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** defaultconstructor.nice 1 Mar 2005 17:36:36 -0000 1.6 --- defaultconstructor.nice 25 Mar 2005 16:40:00 -0000 1.7 *************** *** 141,145 **** let gnu.expr.Expression objectConstructor = new gnu.expr.QuoteExp (new gnu.expr.InitializeProc( ! notNull(gnu.bytecode.Type.pointer_type).getDeclaredMethod("<init>", 0))); /** --- 141,145 ---- let gnu.expr.Expression objectConstructor = new gnu.expr.QuoteExp (new gnu.expr.InitializeProc( ! gnu.bytecode.Type.pointer_type.getDeclaredMethod("<init>", 0))); /** Index: javaMethod.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/javaMethod.nice,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** javaMethod.nice 11 Mar 2005 17:35:52 -0000 1.10 --- javaMethod.nice 25 Mar 2005 16:40:00 -0000 1.11 *************** *** 119,124 **** knownMethods.put(m.getName(), methods = new ArrayList()); - assert methods != null; - methods.add(m); } --- 119,122 ---- *************** *** 284,289 **** superClass = gnu.bytecode.Type.pointer_type; - assert superClass != null; // Typechecker limitation - res = alreadyHasMethod(superClass,m); if (res != null) --- 282,285 ---- *************** *** 342,346 **** { if (javaObjectConstructor == null) ! javaObjectConstructor = makeJavaMethod(getDeclaredMethod(notNull(gnu.bytecode.Type.pointer_type),"<init>", 0), true); return notNull(javaObjectConstructor); --- 338,342 ---- { if (javaObjectConstructor == null) ! javaObjectConstructor = makeJavaMethod(getDeclaredMethod(gnu.bytecode.Type.pointer_type,"<init>", 0), true); return notNull(javaObjectConstructor); Index: typeConstructors.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typeConstructors.nice,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** typeConstructors.nice 24 Mar 2005 22:36:46 -0000 1.4 --- typeConstructors.nice 25 Mar 2005 16:40:00 -0000 1.5 *************** *** 40,46 **** { l = new LinkedList(); ! constructorsMap.put(tc, notNull(l)); } ! notNull(l).add(m.getSymbol()); } --- 40,46 ---- { l = new LinkedList(); ! constructorsMap.put(tc, l); } ! l.add(m.getSymbol()); } Index: symbol.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/symbol.nice,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** symbol.nice 10 Mar 2005 23:42:38 -0000 1.15 --- symbol.nice 25 Mar 2005 16:40:00 -0000 1.16 *************** *** 163,167 **** let k = nice.tools.typing.Types.rawType(type).getKind(); if (k instanceof mlsub.typing.FunTypeKind) ! if (!notNull(arguments).plainApplication(k.domainArity, this)) return 0; else --- 163,167 ---- let k = nice.tools.typing.Types.rawType(type).getKind(); if (k instanceof mlsub.typing.FunTypeKind) ! if (!arguments.plainApplication(k.domainArity, this)) return 0; else *************** *** 177,182 **** { int arity = k.domainArity; ! if (notNull(arguments).size() != arity) ! return notNull(name) + Util.has(arity, "parameter", notNull(arguments).size()); else // If the number of arguments is correct, it must be that --- 177,182 ---- { int arity = k.domainArity; ! if (arguments.size() != arity) ! return notNull(name) + Util.has(arity, "parameter", arguments.size()); else // If the number of arguments is correct, it must be that *************** *** 292,296 **** mlsub.typing.Monotype m = nice.tools.typing.Types.rawType( ! notNull(this.getType()).getMonotype()); if (m instanceof mlsub.typing.FunType) return bossa.util.Util.map("", ", ", "", m.domain()); --- 292,296 ---- mlsub.typing.Monotype m = nice.tools.typing.Types.rawType( ! this.getType().getMonotype()); if (m instanceof mlsub.typing.FunType) return bossa.util.Util.map("", ", ", "", m.domain()); Index: javaclass.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/javaclass.nice,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** javaclass.nice 11 Mar 2005 17:35:52 -0000 1.8 --- javaclass.nice 25 Mar 2005 16:40:00 -0000 1.9 *************** *** 244,248 **** return null; ! let compilation = notNull(Node.compilation); if (compilation.javaTypeConstructors.containsKey(classType)) --- 244,248 ---- return null; ! let compilation = Node.compilation; if (compilation.javaTypeConstructors.containsKey(classType)) Index: super.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/super.nice,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** super.nice 16 Jan 2005 00:28:21 -0000 1.12 --- super.nice 25 Mar 2005 16:40:00 -0000 1.13 *************** *** 187,191 **** return null; ! return superClass.getMethod(notNull(thisMethod).getName(), ! notNull(thisMethod).getParameterTypes(), true); } --- 187,191 ---- return null; ! return superClass.getMethod(thisMethod.getName(), ! thisMethod.getParameterTypes(), true); } Index: importedconstructor.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/importedconstructor.nice,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** importedconstructor.nice 6 Mar 2005 01:34:26 -0000 1.16 --- importedconstructor.nice 25 Mar 2005 16:40:00 -0000 1.17 *************** *** 104,108 **** let name = new LocatedString("<init>",def.getDefinition().location()); let parameters = readParametersFromBytecodeAttribute(attr, ! notNull(notNull(Node.compilation).parser)); let res = new ImportedConstructor(name, Node.down, --- 104,108 ---- let name = new LocatedString("<init>",def.getDefinition().location()); let parameters = readParametersFromBytecodeAttribute(attr, ! notNull(Node.compilation.parser)); let res = new ImportedConstructor(name, Node.down, Index: globalvar.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/globalvar.nice,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** globalvar.nice 12 Mar 2005 02:41:47 -0000 1.8 --- globalvar.nice 25 Mar 2005 16:40:00 -0000 1.9 *************** *** 81,85 **** res = new gnu.expr.Declaration (notNull(name).toString(), nice.tools.code.Types.javaType(type)); ! this.setDeclaration(notNull(res)); if (! definition.inInterfaceFile()) --- 81,85 ---- res = new gnu.expr.Declaration (notNull(name).toString(), nice.tools.code.Types.javaType(type)); ! this.setDeclaration(res); if (! definition.inInterfaceFile()) *************** *** 87,91 **** // Compute the value first, which might use another global value, // which will then be properly initialized before use. ! notNull(res).noteValue(definition.compileValue()); } --- 87,91 ---- // Compute the value first, which might use another global value, // which will then be properly initialized before use. ! res.noteValue(definition.compileValue()); } Index: monotype.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/monotype.nice,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** monotype.nice 16 Feb 2005 22:35:06 -0000 1.12 --- monotype.nice 25 Mar 2005 16:40:00 -0000 1.13 *************** *** 274,280 **** rawResolve(tm) { ! return new mlsub.typing.FunType ! (resolveMonotypes(notNull(tm), in), ! out.resolve(tm)); } --- 274,278 ---- rawResolve(tm) { ! return new mlsub.typing.FunType(resolveMonotypes(tm,in), out.resolve(tm)); } |
From: Arjan B. <ar...@us...> - 2005-03-25 13:47:11
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16764/F:/nice/src/bossa/syntax Modified Files: pattern.nice Log Message: Avoid using '@' in error messages. Index: pattern.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/pattern.nice,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** pattern.nice 6 Mar 2005 01:34:26 -0000 1.21 --- pattern.nice 25 Mar 2005 13:46:59 -0000 1.22 *************** *** 675,679 **** { let res = new StringBuffer(); ! res.append(p.exactlyAt ? "#" : (p.name != null ? "" : "@")); if (p.typeConstructor != null) --- 675,679 ---- { let res = new StringBuffer(); ! res.append(p.exactlyAt ? "#" : ""); if (p.typeConstructor != null) *************** *** 682,687 **** res.append(p.tc); ! if (p.name != null) ! res.append(" " +p.name); return res.toString(); --- 682,686 ---- res.append(p.tc); ! res.append(" " + (p.name != null ? notNull(p.name).toString() : "_")); return res.toString(); |
From: Arjan B. <ar...@us...> - 2005-03-24 22:36:55
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10634/F:/nice/src/bossa/syntax Modified Files: dispatchTest.nice typeConstructors.nice Log Message: Fixed bug in shortcut dispatch test. Index: typeConstructors.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typeConstructors.nice,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** typeConstructors.nice 16 Jan 2005 00:28:21 -0000 1.3 --- typeConstructors.nice 24 Mar 2005 22:36:46 -0000 1.4 *************** *** 80,83 **** boolean isClassTC(mlsub.typing.TypeConstructor tc) { ! return nice.tools.code.Types.get(tc) != null; } --- 80,87 ---- boolean isClassTC(mlsub.typing.TypeConstructor tc) { ! let c = nice.tools.code.Types.get(tc); ! if (c instanceof gnu.bytecode.ClassType) ! return ! c.isInterface(); ! ! return false; } Index: dispatchTest.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/dispatchTest.nice,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** dispatchTest.nice 24 Mar 2005 21:58:11 -0000 1.9 --- dispatchTest.nice 24 Mar 2005 22:36:46 -0000 1.10 *************** *** 67,71 **** if (! trivialTestOK(sortedAlternatives)) ! if (true || ! shortTestOk(m, sortedAlternatives)) testMethod(m, sortedAlternatives, false); --- 67,71 ---- if (! trivialTestOK(sortedAlternatives)) ! if (! shortTestOk(m, sortedAlternatives)) testMethod(m, sortedAlternatives, false); |
From: Daniel B. <bo...@us...> - 2005-03-24 21:58:21
|
Update of /cvsroot/nice/Nice/testsuite/compiler/methods In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18247/testsuite/compiler/methods Modified Files: ambiguity.testsuite Log Message: Temporarily disable the secondary link test optimization, as it is currently overly optimistic (it lets some ambiguities unnoticed). Index: ambiguity.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/methods/ambiguity.testsuite,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ambiguity.testsuite 1 Mar 2005 18:56:21 -0000 1.6 --- ambiguity.testsuite 24 Mar 2005 21:58:11 -0000 1.7 *************** *** 30,32 **** foo(B x, B y) {} foo(B x, B y) {} ! \ No newline at end of file --- 30,47 ---- foo(B x, B y) {} foo(B x, B y) {} ! ! /// FAIL ! /// Toplevel ! interface top { ! int /*/// FAIL HERE */ diamond() = 1; ! } ! ! interface left implements top { ! diamond() = 2; ! } ! interface right implements top { ! diamond() = 3; ! } ! ! class bottom implements left, right {} ! // ambiguity for diamond(bottom) |
From: Daniel B. <bo...@us...> - 2005-03-24 21:58:21
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18247/src/bossa/syntax Modified Files: dispatchTest.nice Log Message: Temporarily disable the secondary link test optimization, as it is currently overly optimistic (it lets some ambiguities unnoticed). Index: dispatchTest.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/dispatchTest.nice,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** dispatchTest.nice 28 Feb 2005 14:10:44 -0000 1.8 --- dispatchTest.nice 24 Mar 2005 21:58:11 -0000 1.9 *************** *** 67,71 **** if (! trivialTestOK(sortedAlternatives)) ! if (! shortTestOk(m, sortedAlternatives)) testMethod(m, sortedAlternatives, false); --- 67,71 ---- if (! trivialTestOK(sortedAlternatives)) ! if (true || ! shortTestOk(m, sortedAlternatives)) testMethod(m, sortedAlternatives, false); |
From: Daniel B. <bo...@us...> - 2005-03-24 14:47:17
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18703 Modified Files: NEWS Log Message: Stop wrapping ClassCastException into gnu.mypping.WrongType. This is only useful in unityped languages like Kawa. This reduces bytecode length and removes the need for adding the WrongType class in generated jars. Index: NEWS =================================================================== RCS file: /cvsroot/nice/Nice/NEWS,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** NEWS 22 Mar 2005 11:22:46 -0000 1.72 --- NEWS 24 Mar 2005 14:47:08 -0000 1.73 *************** *** 44,47 **** --- 44,50 ---- * Removed octal integer literals. * Some error messages locate more precisely the source of the error. + * Generated bytecode is slightly more compact and references less "system" + Nice classes, so that those do not need to be automatically added to + generated jars. * Bug fixes (negative int hex literals, ...) |
From: Daniel B. <bo...@us...> - 2005-03-24 14:47:17
|
Update of /cvsroot/nice/Nice/src/gnu/expr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18703/src/gnu/expr Modified Files: PrimProcedure.java Compilation.java Log Message: Stop wrapping ClassCastException into gnu.mypping.WrongType. This is only useful in unityped languages like Kawa. This reduces bytecode length and removes the need for adding the WrongType class in generated jars. Index: PrimProcedure.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/PrimProcedure.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PrimProcedure.java 25 Aug 2003 18:09:10 -0000 1.9 --- PrimProcedure.java 24 Mar 2005 14:47:07 -0000 1.10 *************** *** 385,390 **** : argTypes[i-1]; Target target = ! source == null ? CheckedTarget.getInstance(arg_type, name, i) ! : CheckedTarget.getInstance(arg_type, source, i); args[i].compileNotePosition(comp, target); if (parameterCopies != null && parameterCopies[i] != null) --- 385,389 ---- : argTypes[i-1]; Target target = ! StackTarget.getInstance(arg_type); args[i].compileNotePosition(comp, target); if (parameterCopies != null && parameterCopies[i] != null) Index: Compilation.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/Compilation.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Compilation.java 3 Sep 2004 18:24:33 -0000 1.25 --- Compilation.java 24 Mar 2005 14:47:07 -0000 1.26 *************** *** 1114,1119 **** Type ptype = var.getType(); if (ptype != Type.pointer_type) ! CheckedTarget.emitCheckedCoerce(this, source, ! k, ptype); var = var.nextDecl(); } --- 1114,1118 ---- Type ptype = var.getType(); if (ptype != Type.pointer_type) ! StackTarget.convert(this, Type.pointer_type, ptype); var = var.nextDecl(); } |
From: Daniel B. <bo...@us...> - 2005-03-24 14:47:16
|
Update of /cvsroot/nice/Nice/src/bossa/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18703/src/bossa/modules Modified Files: Package.java Log Message: Stop wrapping ClassCastException into gnu.mypping.WrongType. This is only useful in unityped languages like Kawa. This reduces bytecode length and removes the need for adding the WrongType class in generated jars. Index: Package.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/modules/Package.java,v retrieving revision 1.140 retrieving revision 1.141 diff -C2 -d -r1.140 -r1.141 *** Package.java 13 Mar 2005 12:15:31 -0000 1.140 --- Package.java 24 Mar 2005 14:47:07 -0000 1.141 *************** *** 578,582 **** String[] classes = { ! "gnu/mapping/Procedure.class", "gnu/mapping/Procedure0.class", "gnu/mapping/Procedure1.class", "gnu/mapping/Procedure2.class", "gnu/mapping/Procedure3.class", "gnu/mapping/ProcedureN.class", "gnu/mapping/Named.class", "gnu/mapping/Printable.class", "gnu/mapping/WrongArguments.class", "gnu/mapping/WrongType.class", "gnu/mapping/WrappedException.class", "gnu/expr/ModuleBody.class", "gnu/expr/ModuleMethod.class" }; --- 578,582 ---- String[] classes = { ! "gnu/mapping/Procedure.class", "gnu/mapping/Procedure0.class", "gnu/mapping/Procedure1.class", "gnu/mapping/Procedure2.class", "gnu/mapping/Procedure3.class", "gnu/mapping/ProcedureN.class", "gnu/mapping/Named.class", "gnu/mapping/Printable.class", "gnu/mapping/WrongArguments.class", "gnu/expr/ModuleBody.class", "gnu/expr/ModuleMethod.class" }; |
From: Daniel B. <bo...@us...> - 2005-03-24 14:47:16
|
Update of /cvsroot/nice/Nice/src/nice/tools/code In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18703/src/nice/tools/code Modified Files: EnsureTypeProc.java Log Message: Stop wrapping ClassCastException into gnu.mypping.WrongType. This is only useful in unityped languages like Kawa. This reduces bytecode length and removes the need for adding the WrongType class in generated jars. Index: EnsureTypeProc.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/code/EnsureTypeProc.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** EnsureTypeProc.java 2 Apr 2003 16:44:50 -0000 1.5 --- EnsureTypeProc.java 24 Mar 2005 14:46:57 -0000 1.6 *************** *** 57,62 **** { oldTarget = target; ! target = new CheckedTarget(type, "nice.tools.code.EnsureTypeProc", ! gnu.mapping.WrongType.ARG_DESCRIPTION); } --- 57,61 ---- { oldTarget = target; ! target = StackTarget.getInstance(type); } |
From: Daniel B. <bo...@us...> - 2005-03-24 10:01:13
|
Update of /cvsroot/nice/Nice/src/nice/tools/testsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15473/src/nice/tools/testsuite Modified Files: TestCase.java Log Message: When running a separate jvm, put the classes directory after the testcase directory, since generated code must have priority over core one. Index: TestCase.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/testsuite/TestCase.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** TestCase.java 23 Mar 2005 17:56:29 -0000 1.34 --- TestCase.java 24 Mar 2005 10:00:57 -0000 1.35 *************** *** 372,376 **** public void runJVM(String jvm, String main) throws TestSuiteException { try { ! Process p = Runtime.getRuntime().exec(jvm + " -classpath classes:" + TestNice.getTempFolder() + " " + main); CharArrayWriter out = new CharArrayWriter(); int exitValue = nice.tools.compiler.dispatch.waitFor(p, out); --- 372,376 ---- public void runJVM(String jvm, String main) throws TestSuiteException { try { ! Process p = Runtime.getRuntime().exec(jvm + " -classpath " + TestNice.getTempFolder() + ":classes " + main); CharArrayWriter out = new CharArrayWriter(); int exitValue = nice.tools.compiler.dispatch.waitFor(p, out); |
From: Daniel B. <bo...@us...> - 2005-03-23 17:56:39
|
Update of /cvsroot/nice/Nice/src/nice/tools/testsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16378/src/nice/tools/testsuite Modified Files: TestNice.java TestCase.java Log Message: Allow testcases to be run in a distinct JVM. Index: TestCase.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/testsuite/TestCase.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** TestCase.java 21 Mar 2005 21:25:57 -0000 1.33 --- TestCase.java 23 Mar 2005 17:56:29 -0000 1.34 *************** *** 370,373 **** --- 370,388 ---- } + public void runJVM(String jvm, String main) throws TestSuiteException { + try { + Process p = Runtime.getRuntime().exec(jvm + " -classpath classes:" + TestNice.getTempFolder() + " " + main); + CharArrayWriter out = new CharArrayWriter(); + int exitValue = nice.tools.compiler.dispatch.waitFor(p, out); + // Print the output of the execution. + System.out.println(out.toString()); + if (exitValue != 0) + throw new TestSuiteException("Exit code: " + exitValue); + } + catch(IOException e) { + throw new TestSuiteException(e.getMessage()); + } + } + /** * Runs the main method of the testcase. Only if main method exists and *************** *** 397,400 **** --- 412,421 ---- && ! _dontCompilePackages.contains(sourceFile.getPackage())) { + if (TestNice.getJVM() != null) + { + runJVM(TestNice.getJVM(), sourceFile.getPackage() + ".fun"); + continue; + } + ClassLoader loader = TestNice.getClassLoader(); try { Index: TestNice.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/testsuite/TestNice.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** TestNice.java 23 Feb 2005 16:57:57 -0000 1.31 --- TestNice.java 23 Mar 2005 17:56:29 -0000 1.32 *************** *** 143,146 **** --- 143,154 ---- /** + A JVM with which to run generated code (in a separate process). + Useful for testing alternative JVMs like Kaffe without using them for + running the testengine and the compilation itself. + */ + private static String _jvm = null; + + + /** * TODO * *************** *** 273,276 **** --- 281,286 ---- else if ("-gcc".equalsIgnoreCase(s)) setGcc(args[i++]); + else if ("-jvm".equalsIgnoreCase(s)) + setJvm(args[i++]); else if ("-comment".equalsIgnoreCase(s)) _writeComments = true; *************** *** 318,321 **** --- 328,335 ---- + private static void setJvm(String jvm) { + _jvm = jvm; + } + /** *************** *** 542,545 **** --- 556,564 ---- + static String getJVM() { + return _jvm; + } + + /** |
From: Daniel B. <bo...@us...> - 2005-03-22 23:38:30
|
Update of /cvsroot/nice/tester In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32652 Modified Files: Flow4j.test gcj.test run Log Message: Use exit code 8 for SKIP and 2 for WARN Index: Flow4j.test =================================================================== RCS file: /cvsroot/nice/tester/Flow4j.test,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Flow4j.test 21 Mar 2005 17:27:55 -0000 1.6 --- Flow4j.test 22 Mar 2005 23:38:03 -0000 1.7 *************** *** 7,11 **** if [ ${JDK_VERSION} ] && expr "${JDK_VERSION}" '<' 1.4.0 >/dev/null; then echo "JDK 1.4 needed for the Flow4j test. Skipping." ! exit 2 fi --- 7,11 ---- if [ ${JDK_VERSION} ] && expr "${JDK_VERSION}" '<' 1.4.0 >/dev/null; then echo "JDK 1.4 needed for the Flow4j test. Skipping." ! exit 8 fi Index: run =================================================================== RCS file: /cvsroot/nice/tester/run,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** run 26 Feb 2005 10:51:42 -0000 1.14 --- run 22 Mar 2005 23:38:20 -0000 1.15 *************** *** 105,110 **** 0) echo "OK" ;; 1) echo "FAILURE" ; failed=true ;; ! 2) echo "SKIP" ;; 3) echo "IMPOSSIBLE" ;; *) echo "$((code-10))" ;; esac --- 105,111 ---- 0) echo "OK" ;; 1) echo "FAILURE" ; failed=true ;; ! 2) echo "WARN" ;; 3) echo "IMPOSSIBLE" ;; + 8) echo "SKIP" ;; *) echo "$((code-10))" ;; esac Index: gcj.test =================================================================== RCS file: /cvsroot/nice/tester/gcj.test,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gcj.test 26 Feb 2005 10:51:42 -0000 1.1 --- gcj.test 22 Mar 2005 23:38:04 -0000 1.2 *************** *** 1,5 **** #! /bin/sh ! [ "$GCJ" ] || exit 2 cd Nice --- 1,5 ---- #! /bin/sh ! [ "$GCJ" ] || exit 8 cd Nice |
From: Daniel B. <bo...@us...> - 2005-03-22 23:33:30
|
Update of /cvsroot/nice/Nice/testsuite/compiler/methods In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29330/testsuite/compiler/methods Modified Files: parameterTypeNaming.testsuite Log Message: Added expected failure locations. Index: parameterTypeNaming.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/methods/parameterTypeNaming.testsuite,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** parameterTypeNaming.testsuite 1 Mar 2005 18:56:21 -0000 1.5 --- parameterTypeNaming.testsuite 22 Mar 2005 23:33:01 -0000 1.6 *************** *** 1,4 **** /// FAIL ! B /* FAIL HERE*/ b = bar(new B()); /// Toplevel interface I {} --- 1,4 ---- /// FAIL ! B /* /// FAIL HERE*/ b = bar(new B()); /// Toplevel interface I {} *************** *** 59,61 **** /// Toplevel // : can only come after a real dispatch, otherwise it is useless. ! <T> foo(a : X) {} --- 59,61 ---- /// Toplevel // : can only come after a real dispatch, otherwise it is useless. ! <T> foo(a : X /*/// FAIL HERE*/ ) {} |
From: Daniel B. <bo...@us...> - 2005-03-22 15:32:25
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19579/src/bossa/syntax Modified Files: typedef.nice Log Message: Properly localize variance errors again. Index: typedef.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typedef.nice,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** typedef.nice 11 Mar 2005 17:35:51 -0000 1.21 --- typedef.nice 22 Mar 2005 15:32:16 -0000 1.22 *************** *** 906,910 **** private void copyVariance(TypeDefinition this, TypeDefinition from) { ! if (this.variance != from.variance) { this.variance = from.variance; --- 906,913 ---- private void copyVariance(TypeDefinition this, TypeDefinition from) { ! if (this.variance != from.variance && ! // Only specialization is supported ! (this.variance == null || ! notNull(this.variance).arity() < notNull(from.variance).arity())) { this.variance = from.variance; |
From: Daniel B. <bo...@us...> - 2005-03-22 15:32:25
|
Update of /cvsroot/nice/Nice/testsuite/compiler/classes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19579/testsuite/compiler/classes Modified Files: extends.testsuite Log Message: Properly localize variance errors again. Index: extends.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/classes/extends.testsuite,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** extends.testsuite 12 Mar 2005 15:06:06 -0000 1.6 --- extends.testsuite 22 Mar 2005 15:32:14 -0000 1.7 *************** *** 2,6 **** /// Toplevel class A<T> { T x;} ! class B<T,U> extends A<T> { U y; } /// FAIL --- 2,6 ---- /// Toplevel class A<T> { T x;} ! class /*/// FAIL HERE */ B<T,U> extends A<T> { U y; } /// FAIL |
From: Daniel B. <bo...@us...> - 2005-03-22 11:31:47
|
Update of /cvsroot/nice/Nice/testsuite/compiler/classes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20565/testsuite/compiler/classes Modified Files: specialization.testsuite Log Message: Using this in the initializer of a class with specialized type parameters. Index: specialization.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/classes/specialization.testsuite,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** specialization.testsuite 16 Feb 2005 22:34:49 -0000 1.11 --- specialization.testsuite 22 Mar 2005 11:31:38 -0000 1.12 *************** *** 192,193 **** --- 192,205 ---- /// package b import a C c = new C(0); + + /// PASS bug + /// Toplevel + class A<T> {} + void foo(A<int> a) {} + + class B extends A<int> + { + { + foo(this); + } + } |
From: Daniel B. <bo...@us...> - 2005-03-22 11:22:56
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15934 Modified Files: NEWS Log Message: Some error messages locate more precisely the source of the error. Index: NEWS =================================================================== RCS file: /cvsroot/nice/Nice/NEWS,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** NEWS 12 Mar 2005 16:26:15 -0000 1.71 --- NEWS 22 Mar 2005 11:22:46 -0000 1.72 *************** *** 39,47 **** ... } ! * Added instanceof on option types. For instance 'x instanceof ?String' ! is equivalent to 'x == null || x instanceof String'. ! * Added binary integer literals. Examples: '0B1011' '0b1010_0000_0101_1111'. ! * Removed octal integer literals. ! * Bug fixes (negative int hex literals, ...) -- --- 39,48 ---- ... } ! * Added instanceof on option types. For instance 'x instanceof ?String' ! is equivalent to 'x == null || x instanceof String'. ! * Added binary integer literals. Examples: '0B1011' '0b1010_0000_0101_1111'. ! * Removed octal integer literals. ! * Some error messages locate more precisely the source of the error. ! * Bug fixes (negative int hex literals, ...) -- |
From: Daniel B. <bo...@us...> - 2005-03-22 10:55:16
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1446/src/bossa/parser Modified Files: Parser.jj JavaccParser.java Log Message: Localize error message for unclosed comments. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.321 retrieving revision 1.322 diff -C2 -d -r1.321 -r1.322 *** Parser.jj 21 Mar 2005 16:55:35 -0000 1.321 --- Parser.jj 22 Mar 2005 10:55:06 -0000 1.322 *************** *** 93,103 **** /* COMMENTS */ ! TOKEN_MGR_DECLS : { int nestingLevel = 0; } MORE : { ! <"/**" ~["/"]> { input_stream.backup(1); } : IN_FORMAL_COMMENT | ! "/*" {nestingLevel++; }: IN_MULTI_LINE_COMMENT } --- 93,117 ---- /* COMMENTS */ ! TOKEN_MGR_DECLS : { int nestingLevel = 0; Location commentStart = null; } MORE : { ! <"/**" ~["/"]> ! { ! if (commentStart == null) ! commentStart = Location.make ! (input_stream.getBeginLine(), input_stream.getBeginColumn(), ! input_stream.getEndLine(), input_stream.getEndColumn()); ! input_stream.backup(1); ! } : IN_FORMAL_COMMENT | ! "/*" ! { ! if (commentStart == null) ! commentStart = Location.make ! (input_stream.getBeginLine(), input_stream.getBeginColumn(), ! input_stream.getEndLine(), input_stream.getEndColumn()); ! nestingLevel++; ! }: IN_MULTI_LINE_COMMENT } *************** *** 120,124 **** SKIP : { ! "*/" { if (--nestingLevel == 0) SwitchTo(DEFAULT); } } --- 134,138 ---- SKIP : { ! "*/" { if (--nestingLevel == 0) { commentStart = null; SwitchTo(DEFAULT); } } } Index: JavaccParser.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/JavaccParser.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** JavaccParser.java 17 Jan 2005 13:16:56 -0000 1.4 --- JavaccParser.java 22 Mar 2005 10:55:06 -0000 1.5 *************** *** 76,83 **** String message = e.getMessage(); if (message.indexOf("<EOF>") != -1) ! message = "Unexpected end of file"; User.error(Location.nowhere(), message); } ! } finally { chrono.stop(); --- 76,86 ---- String message = e.getMessage(); if (message.indexOf("<EOF>") != -1) ! if (parser.token_source.commentStart != null) ! User.error(parser.token_source.commentStart, "Unclosed comment"); ! else ! message = "Unexpected end of file"; User.error(Location.nowhere(), message); } ! } finally { chrono.stop(); |