nice-commit Mailing List for The Nice Programming Language (Page 37)
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: Arjan B. <ar...@us...> - 2004-09-03 18:24:42
|
Update of /cvsroot/nice/Nice/src/gnu/expr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5243/F:/nice/src/gnu/expr Modified Files: Compilation.java Log Message: Silenced superfluous 'cannot convert literal' warnings. Index: Compilation.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/Compilation.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Compilation.java 11 Jun 2004 05:01:39 -0000 1.24 --- Compilation.java 3 Sep 2004 18:24:33 -0000 1.25 *************** *** 472,476 **** catch (Exception ex) { ! error('w', "cannot convert literal (of type " + value.getClass().getName() + ") to " + type.getName()); --- 472,477 ---- catch (Exception ex) { ! if (value != Values.empty) ! error('w', "cannot convert literal (of type " + value.getClass().getName() + ") to " + type.getName()); |
From: Arjan B. <ar...@us...> - 2004-09-03 18:07:37
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2472/F:/nice/src/bossa/syntax Modified Files: if.nice rewrite.nice statementexp.nice typecheck.nice Removed Files: ExpressionStmt.java Log Message: Converted ExpressionStmt to Nice code. Index: statementexp.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/statementexp.nice,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** statementexp.nice 13 Aug 2004 21:04:41 -0000 1.2 --- statementexp.nice 3 Sep 2004 18:07:27 -0000 1.3 *************** *** 36,37 **** --- 36,57 ---- } + + /** + Compute an expression and forget the value. + + */ + public class ExpressionStmt extends Statement + { + Expression exp; + + generateCode() = exp.generateCode(); + + toString() = exp.toString() + ";"; + } + + Statement createExpressionStmt(Expression exp) + { + let res = new ExpressionStmt(exp: exp); + res.setLocation(exp.location()); + return res; + } Index: if.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/if.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** if.nice 28 Jul 2004 14:40:33 -0000 1.1 --- if.nice 3 Sep 2004 18:07:27 -0000 1.2 *************** *** 79,82 **** new StatementExp(statement: elseStmt))); ifExp.setLocation(loc); ! return new ExpressionStmt(ifExp); } \ No newline at end of file --- 79,82 ---- new StatementExp(statement: elseStmt))); ifExp.setLocation(loc); ! return createExpressionStmt(ifExp); } \ No newline at end of file --- ExpressionStmt.java DELETED --- Index: rewrite.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/rewrite.nice,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** rewrite.nice 8 Aug 2004 21:51:54 -0000 1.6 --- rewrite.nice 3 Sep 2004 18:07:27 -0000 1.7 *************** *** 76,80 **** Statement makeStatement(Expression); ! makeStatement(Expression e) = new ExpressionStmt(e); makeStatement(StatementExp e) = e.statement; --- 76,80 ---- Statement makeStatement(Expression); ! makeStatement(Expression e) = createExpressionStmt(e); makeStatement(StatementExp e) = e.statement; Index: typecheck.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v retrieving revision 1.114 retrieving revision 1.115 diff -C2 -d -r1.114 -r1.115 *** typecheck.nice 25 Aug 2004 19:57:20 -0000 1.114 --- typecheck.nice 3 Sep 2004 18:07:27 -0000 1.115 *************** *** 829,833 **** typecheck(ExpressionStmt s) { ! s.exp = notNull(s.exp).noOverloading(); typecheck(s.exp); } --- 829,833 ---- typecheck(ExpressionStmt s) { ! s.exp = s.exp.noOverloading(); typecheck(s.exp); } |
From: Arjan B. <ar...@us...> - 2004-09-03 18:07:36
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2472/F:/nice/src/bossa/parser Modified Files: Parser.jj Log Message: Converted ExpressionStmt to Nice code. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.262 retrieving revision 1.263 diff -C2 -d -r1.262 -r1.263 *** Parser.jj 2 Sep 2004 19:12:10 -0000 1.262 --- Parser.jj 3 Sep 2004 18:07:24 -0000 1.263 *************** *** 887,891 **** Expression exp = bossa.syntax.dispatch.createAssignExp(new TupleExp(parts),new IdentExp(ident)); exp.setLocation(makeLocation(first,last)); ! statements.add(new ExpressionStmt(exp)); t = new TupleType(types, makeLocation(first, last)); t.nullness = Monotype.absent; --- 887,891 ---- Expression exp = bossa.syntax.dispatch.createAssignExp(new TupleExp(parts),new IdentExp(ident)); exp.setLocation(makeLocation(first,last)); ! statements.add(bossa.syntax.dispatch.createExpressionStmt(exp)); t = new TupleType(types, makeLocation(first, last)); t.nullness = Monotype.absent; *************** *** 1133,1137 **** "new" name=ident() "(" params=formalParameters(false, statements) ")" ( ! "=" exp=Expression() ";" { statements.add(new ExpressionStmt(exp)); } | "{" --- 1133,1137 ---- "new" name=ident() "(" params=formalParameters(false, statements) ")" ( ! "=" exp=Expression() ";" { statements.add(bossa.syntax.dispatch.createExpressionStmt(exp)); } | "{" *************** *** 1781,1785 **** Expression exp = bossa.syntax.dispatch.createAssignExp(new TupleExp(parts),new IdentExp(name)); exp.setLocation(makeLocation(first,last)); ! statements.add(new ExpressionStmt(exp)); type = new TupleType(types, makeLocation(first, last)); type.nullness = Monotype.absent; --- 1781,1785 ---- Expression exp = bossa.syntax.dispatch.createAssignExp(new TupleExp(parts),new IdentExp(name)); exp.setLocation(makeLocation(first,last)); ! statements.add(bossa.syntax.dispatch.createExpressionStmt(exp)); type = new TupleType(types, makeLocation(first, last)); type.nullness = Monotype.absent; *************** *** 2547,2551 **** { Expression exp = bossa.syntax.dispatch.createAssignExp(new TupleExp(parts), e); exp.setLocation(makeLocation(first,last)); ! return new ExpressionStmt(exp); } } --- 2547,2551 ---- { Expression exp = bossa.syntax.dispatch.createAssignExp(new TupleExp(parts), e); exp.setLocation(makeLocation(first,last)); ! return bossa.syntax.dispatch.createExpressionStmt(exp); } } *************** *** 2655,2659 **** last = getToken(0); e1.setLocation(makeLocation(first, last)); ! return new ExpressionStmt(e1); } } --- 2655,2659 ---- last = getToken(0); e1.setLocation(makeLocation(first, last)); ! return bossa.syntax.dispatch.createExpressionStmt(e1); } } *************** *** 2685,2689 **** last = getToken(0); e1.setLocation(makeLocation(first, last)); ! return new ExpressionStmt(e1); } --- 2685,2689 ---- last = getToken(0); e1.setLocation(makeLocation(first, last)); ! return bossa.syntax.dispatch.createExpressionStmt(e1); } *************** *** 2850,2854 **** { t="throw" e=Expression() ! { return new ExpressionStmt(bossa.syntax.dispatch.createCallExp(symb(t),e)); } } --- 2850,2854 ---- { t="throw" e=Expression() ! { return bossa.syntax.dispatch.createExpressionStmt(bossa.syntax.dispatch.createCallExp(symb(t),e)); } } *************** *** 2886,2890 **** { call = bossa.syntax.dispatch.createCallExp(symb(t), condition); } ) ! { return new ExpressionStmt(call); } } --- 2886,2890 ---- { call = bossa.syntax.dispatch.createCallExp(symb(t), condition); } ) ! { return bossa.syntax.dispatch.createExpressionStmt(call); } } |
From: Arjan B. <ar...@us...> - 2004-09-03 16:21:59
|
Update of /cvsroot/nice/Nice/src/nice/tools/compiler/console In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16439/F:/nice/src/nice/tools/compiler/console Modified Files: listener.nice Log Message: Warning prefix for warnings in the console. Index: listener.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/compiler/console/listener.nice,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** listener.nice 20 Feb 2004 02:51:57 -0000 1.3 --- listener.nice 3 Sep 2004 16:21:49 -0000 1.4 *************** *** 40,46 **** super; if (location != null) ! System.out.println("\n" + location + ":\n" + message); else ! System.out.println("\n" + message); } --- 40,46 ---- super; if (location != null) ! System.out.println("\n" + location + ":\nwarning: " + message); else ! System.out.println("\nwarning: " + message); } |
From: Arjan B. <ar...@us...> - 2004-09-03 11:45:13
|
Update of /cvsroot/nice/Nice/src/gnu/expr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2544/F:/nice/src/gnu/expr Modified Files: Interpreter.java KawaConvert.java Log Message: Removed dependency on the gnu.math package. Index: Interpreter.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/Interpreter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Interpreter.java 30 Oct 2001 15:16:50 -0000 1.2 --- Interpreter.java 3 Sep 2004 11:45:01 -0000 1.3 *************** *** 318,322 **** public Object coerceToObject(int val) { ! return gnu.math.IntNum.make(val); } --- 318,323 ---- public Object coerceToObject(int val) { ! //return gnu.math.IntNum.make(val); ! return null; } Index: KawaConvert.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/KawaConvert.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** KawaConvert.java 30 Oct 2001 15:16:50 -0000 1.1 --- KawaConvert.java 3 Sep 2004 11:45:02 -0000 1.2 *************** *** 14,18 **** public static void setInstance(Convert value) { instance = value; }; ! public Object charToObject(char ch) { --- 14,18 ---- public static void setInstance(Convert value) { instance = value; }; ! /* public Object charToObject(char ch) { *************** *** 74,78 **** return gnu.math.DFloNum.make(value); } ! } --- 74,78 ---- return gnu.math.DFloNum.make(value); } ! */ } |
From: Arjan B. <ar...@us...> - 2004-09-03 11:45:13
|
Update of /cvsroot/nice/Nice/src/gnu/mapping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2544/F:/nice/src/gnu/mapping Modified Files: CallContext.java Log Message: Removed dependency on the gnu.math package. Index: CallContext.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/mapping/CallContext.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CallContext.java 26 Nov 2001 11:09:50 -0000 1.3 --- CallContext.java 3 Sep 2004 11:45:02 -0000 1.4 *************** *** 1,4 **** package gnu.mapping; ! import gnu.math.*; import gnu.lists.*; --- 1,4 ---- package gnu.mapping; ! //import gnu.math.*; import gnu.lists.*; *************** *** 63,68 **** case ARG_IN_VALUE3: return value3; case ARG_IN_VALUE4: return value4; ! case ARG_IN_IVALUE1: return IntNum.make(ivalue1); ! case ARG_IN_IVALUE2: return IntNum.make(ivalue2); } } --- 63,68 ---- case ARG_IN_VALUE3: return value3; case ARG_IN_VALUE4: return value4; ! //case ARG_IN_IVALUE1: return IntNum.make(ivalue1); ! //case ARG_IN_IVALUE2: return IntNum.make(ivalue2); } } |
From: Daniel B. <bo...@us...> - 2004-09-02 19:22:29
|
Update of /cvsroot/nice/Nice/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7803/web Modified Files: Makefile Log Message: Create the PS version of the manual from the PDF version using pdftops. Index: Makefile =================================================================== RCS file: /cvsroot/nice/Nice/web/Makefile,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Makefile 2 Sep 2004 19:13:07 -0000 1.15 --- Makefile 2 Sep 2004 19:22:20 -0000 1.16 *************** *** 40,43 **** --- 40,46 ---- rm manual.fo + manual.ps: manual.pdf + pdftops manual.pdf + %.html: %.xml new.xsl if ! $(PROC) new.xsl $*.xml > $@; then rm $@; fi |
From: Daniel B. <bo...@us...> - 2004-09-02 19:13:17
|
Update of /cvsroot/nice/Nice/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6228/web Modified Files: Makefile Log Message: Create the PDF version of the manual using fop, since xmlto is broken at the moment. Index: Makefile =================================================================== RCS file: /cvsroot/nice/Nice/web/Makefile,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Makefile 9 Dec 2003 17:26:03 -0000 1.14 --- Makefile 2 Sep 2004 19:13:07 -0000 1.15 *************** *** 35,38 **** --- 35,43 ---- xmlto $(shell expr match $@ 'manual\.\(.*\)') manual.xml + manual.pdf: manual.xml + xsltproc --stringparam fop.extensions 1 -o manual.fo /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/fo/docbook.xsl manual.xml + fop manual.fo -pdf manual.pdf + rm manual.fo + %.html: %.xml new.xsl if ! $(PROC) new.xsl $*.xml > $@; then rm $@; fi |
From: Arjan B. <ar...@us...> - 2004-09-02 19:12:19
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6016/F:/nice/src/bossa/parser Modified Files: Parser.jj Log Message: Make multi argument 'array' indexing possible. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.261 retrieving revision 1.262 diff -C2 -d -r1.261 -r1.262 *** Parser.jj 2 Sep 2004 18:23:26 -0000 1.261 --- Parser.jj 2 Sep 2004 19:12:10 -0000 1.262 *************** *** 2263,2269 **** } { ! { Token t; } ! t="[" res=Expression() "]" ! { return bossa.syntax.dispatch.createCallExp(symb("get",t,false),start,res); } | "." res=identExp() --- 2263,2272 ---- } { ! { Token t; List bracketArgs = new ArrayList(); ! bracketArgs.add(new Arguments.Argument(start)); } ! t="[" res=Expression() {bracketArgs.add(new Arguments.Argument(res));} ! ( "," res=Expression() {bracketArgs.add(new Arguments.Argument(res));} )* ! "]" ! { return bossa.syntax.dispatch.createCallExp(symb("get",t,false),new Arguments(bracketArgs)); } | "." res=identExp() |
From: Arjan B. <ar...@us...> - 2004-09-02 19:12:19
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6016/F:/nice/src/bossa/syntax Modified Files: assign.nice tools.nice Log Message: Make multi argument 'array' indexing possible. Index: tools.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/tools.nice,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** tools.nice 2 Sep 2004 15:46:32 -0000 1.49 --- tools.nice 2 Sep 2004 19:12:09 -0000 1.50 *************** *** 188,191 **** --- 188,192 ---- LocatedString name(VarSymbol) = native VarSymbol.name; + Arguments.Argument[] arguments(Arguments) = native Arguments.arguments; mlsub.typing.Polytype getType(Expression) = native mlsub.typing.Polytype Expression.getType(); Index: assign.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/assign.nice,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** assign.nice 5 Aug 2004 10:45:30 -0000 1.2 --- assign.nice 2 Sep 2004 19:12:09 -0000 1.3 *************** *** 38,49 **** public Expression createAssignExp(Expression to, Expression value) { ! // Rewrite "get(e, i) = v" into "set(e, i, v)" if (to instanceof CallExp && "get".equals(notNull(to.function).toString())) ! return createCallExp( new IdentExp(new LocatedString("set", notNull(to.function).location())), ! to.arguments.getExp(0), ! to.arguments.getExp(1), ! value); ! return new AssignExp(to: to, value: value); } --- 38,52 ---- public Expression createAssignExp(Expression to, Expression value) { ! // Rewrite "get(e, i, ...) = v" into "set(e, i, ... , v)" if (to instanceof CallExp && "get".equals(notNull(to.function).toString())) ! { ! List<Arguments.Argument> args = new ArrayList(to.arguments.arguments); ! args.add(new Arguments.Argument(value)); ! ! return createCallExp( new IdentExp(new LocatedString("set", notNull(to.function).location())), ! new Arguments(args.toArray())); ! } ! return new AssignExp(to: to, value: value); } |
From: Arjan B. <ar...@us...> - 2004-09-02 18:23:38
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27251/Nice Modified Files: NEWS Log Message: Allow underscores in literal numbers. Index: NEWS =================================================================== RCS file: /cvsroot/nice/Nice/NEWS,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** NEWS 1 Sep 2004 11:48:34 -0000 1.46 --- NEWS 2 Sep 2004 18:23:27 -0000 1.47 *************** *** 24,27 **** --- 24,29 ---- * Improved speed of coverage tests for some methods. * Removed the '--strict' compiler option. + * Underscores are allowed and ignored in literal numbers. example: + long x = 1_000_123_000_456; * Lists now support a wide array of slicing and indexing operations. There is a new bit of syntax, '@', which indicates |
From: Arjan B. <ar...@us...> - 2004-09-02 18:23:38
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27251/F:/nice/src/bossa/parser Modified Files: Parser.jj Log Message: Allow underscores in literal numbers. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.260 retrieving revision 1.261 diff -C2 -d -r1.260 -r1.261 *** Parser.jj 2 Sep 2004 15:46:32 -0000 1.260 --- Parser.jj 2 Sep 2004 18:23:26 -0000 1.261 *************** *** 264,272 **** > | ! < #DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])* > | ! < #HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+ > | ! < #OCTAL_LITERAL: "0" (["0"-"7"])* > } --- 264,272 ---- > | ! < #DECIMAL_LITERAL: ["1"-"9"] (["0"-"9", "_"])* > | ! < #HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F","_"])+ > | ! < #OCTAL_LITERAL: "0" (["0"-"7","_"])* > } *************** *** 274,284 **** { < FLOATING_POINT_LITERAL: ! (["0"-"9"])+ "." (["0"-"9"])+ (<EXPONENT>)? (["f","F","d","D"])? ! | "." (["0"-"9"])+ (<EXPONENT>)? (["f","F","d","D"])? ! | (["0"-"9"])+ <EXPONENT> (["f","F","d","D"])? ! | (["0"-"9"])+ (<EXPONENT>)? ["f","F","d","D"] > | ! < #EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+ > } --- 274,284 ---- { < FLOATING_POINT_LITERAL: ! ["0"-"9"] (["0"-"9", "_"])* "." (["0"-"9", "_"])+ (<EXPONENT>)? (["f","F","d","D"])? ! | "." (["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"] > | ! < #EXPONENT: ["e","E"] (["+","-"])? (["0"-"9", "_"])+ > } |
From: Arjan B. <ar...@us...> - 2004-09-02 18:23:38
|
Update of /cvsroot/nice/Nice/testsuite/compiler/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27251/F:/nice/testsuite/compiler/syntax Modified Files: expressions.testsuite Log Message: Allow underscores in literal numbers. Index: expressions.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/syntax/expressions.testsuite,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** expressions.testsuite 24 Jun 2004 14:02:42 -0000 1.7 --- expressions.testsuite 2 Sep 2004 18:23:27 -0000 1.8 *************** *** 21,22 **** --- 21,29 ---- /// TOPLEVEL String->String->void f4(String x) = String y => String z => {}; + + + /// PASS + assert 123456 == 123_456; + assert 0x1_2_3_4 == 0x1234; + assert 0.000_012 == 0.000012; + assert 1_000.000_1d == 1000.0001d; |
From: Arjan B. <ar...@us...> - 2004-09-02 18:23:37
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27251/F:/nice/src/bossa/syntax Modified Files: ConstantExp.java Log Message: Allow underscores in literal numbers. Index: ConstantExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/ConstantExp.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** ConstantExp.java 2 Sep 2004 15:46:32 -0000 1.52 --- ConstantExp.java 2 Sep 2004 18:23:25 -0000 1.53 *************** *** 198,202 **** try{ ! long value = parse(rep); return makeInt(value, isLong, representation.location()); } --- 198,202 ---- try{ ! long value = parse(removeUnderscores(rep)); return makeInt(value, isLong, representation.location()); } *************** *** 259,265 **** } public static ConstantExp makeFloating(LocatedString representation) { ! String repres = representation.toString(); if (repres.endsWith("F") || repres.endsWith("f")) { --- 259,275 ---- } + static String removeUnderscores(String s) + { + StringBuffer sb = new StringBuffer(); + for (int i = 0; i<s.length(); i++) + if (s.charAt(i) != '_') + sb.append(s.charAt(i)); + + return sb.toString(); + } + public static ConstantExp makeFloating(LocatedString representation) { ! String repres = removeUnderscores(representation.toString()); if (repres.endsWith("F") || repres.endsWith("f")) { |
From: Arjan B. <ar...@us...> - 2004-09-02 16:53:58
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10170/F:/nice/stdlib/nice/lang Modified Files: java-io.nice Log Message: Added println() function. Index: java-io.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/java-io.nice,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** java-io.nice 20 Mar 2004 15:25:30 -0000 1.4 --- java-io.nice 2 Sep 2004 16:53:44 -0000 1.5 *************** *** 37,40 **** --- 37,41 ---- <T> void print (T object) = System.out.print (object); <T> void println (T object) = System.out.println(object); + void println() = System.out.println(); // Constructors |
From: Daniel B. <bo...@us...> - 2004-09-02 16:49:09
|
Update of /cvsroot/nice/Nice/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9213/web Modified Files: manual.xml Log Message: Updated "Using Nice from Java" section, now that most methods are compiled as instance methods. Index: manual.xml =================================================================== RCS file: /cvsroot/nice/Nice/web/manual.xml,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** manual.xml 27 Feb 2004 01:30:58 -0000 1.38 --- manual.xml 2 Sep 2004 16:48:58 -0000 1.39 *************** *** 1679,1691 **** </para> ! <section><title>Calling a method</title> <para> ! You can call a <link linkend="method">method</link> ! <literal>m</literal> ! defined in a nice package <literal>pkg</literal> by naming it <literal>pkg.dispatch.m</literal> in the Java program. ! It does not matter in what package(s) <literal>m</literal> ! is implemented: ! <literal>pkg</literal> must simply be the package where the method was declared. </para> --- 1679,1699 ---- </para> ! <section id="compilationMethods"><title>Calling a method</title> ! <para> ! For <link linkend="method">methods</link> declared inside a ! class, and for those declared at the package level and whose ! first argument is a Nice class, you can simply use them as ! usual in Java. ! </para> <para> ! This is not possible for methods declared at the package ! level and whose first argument is a Java class, a possibly ! null type or a primitive type. ! You can call a such a method <literal>m</literal> ! declared in a nice package <literal>pkg</literal> by naming it <literal>pkg.dispatch.m</literal> in the Java program. ! It does not matter in what package(s) <literal>m</literal> ! is implemented: ! <literal>pkg</literal> must simply be the package where the method was declared. </para> *************** *** 1721,1726 **** // A method: ! String display(); ! display() = "Person: " + name; } --- 1729,1733 ---- // A method: ! String display() = "Person: " + name; } *************** *** 1731,1735 **** display() = "Worker: " + name + " salary: " + salary; - // A method: boolean isRich() = salary > 500; } --- 1738,1741 ---- *************** *** 1750,1756 **** Worker w = new Worker("Julia", 1000); ! System.out.println(dispatch.display(p)); ! System.out.println(dispatch.display(w)); ! if (fun.isRich(w)) System.out.println("A well paid worker!"); } --- 1756,1762 ---- Worker w = new Worker("Julia", 1000); ! System.out.println(p.display()); ! System.out.println(w.display()); ! if (w.isRich()) System.out.println("A well paid worker!"); } *************** *** 1759,1763 **** </para> </example> ! </para></section> <section><title>Optional parameters</title> --- 1765,1770 ---- </para> </example> ! </para> ! </section> <section><title>Optional parameters</title> *************** *** 1780,1785 **** The constructor will need to call the <link linkend="constructorFromJava">parent constructor</link>. ! It is not possible to override a Nice multi-methods in a Java ! program. </para> </section> --- 1787,1796 ---- The constructor will need to call the <link linkend="constructorFromJava">parent constructor</link>. ! It is not fully possible to override a Nice multi-method in a Java ! program. However, provided that the method is compiled as an ! instance method, as specified <link ! linkend="compilationMethods">above</link>, you can override ! that method as usual for Java. That is, only the first ! (implicit) argument can be used to perform the override. </para> </section> |
From: Arjan B. <ar...@us...> - 2004-09-02 15:46:44
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29818/F:/nice/src/bossa/syntax Modified Files: ConstantExp.java EnumDefinition.java analyse.nice dispatch.java.bootstrap pattern.nice tools.nice Added Files: constant.nice Removed Files: NullExp.java StringConstantExp.java TypeConstantExp.java VoidConstantExp.java Log Message: Converted constantExp subclasses to Nice code. Index: analyse.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/analyse.nice,v retrieving revision 1.110 retrieving revision 1.111 diff -C2 -d -r1.110 -r1.111 *** analyse.nice 13 Aug 2004 21:04:41 -0000 1.110 --- analyse.nice 2 Sep 2004 15:46:32 -0000 1.111 *************** *** 351,355 **** throw unknownIdent(notNull(pkg.locatedName())); ! return TypeConstantExp.create(pkg, nextComponent); } } --- 351,355 ---- throw unknownIdent(notNull(pkg.locatedName())); ! return createTypeConstantExp(pkg, nextComponent); } } *************** *** 539,543 **** if (e.enableClassExp) ! return notNull(TypeConstantExp.create(e.ident)); throw unknownIdent(notNull(e.ident)); --- 539,543 ---- if (e.enableClassExp) ! return createTypeConstantExp(null, notNull(e.ident)); throw unknownIdent(notNull(e.ident)); *************** *** 647,651 **** } ! return TypeConstantExp.universalPolytype(tc, sure); } --- 647,651 ---- } ! return universalPolytype(tc, sure); } Index: pattern.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/pattern.nice,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pattern.nice 14 Aug 2004 11:14:15 -0000 1.2 --- pattern.nice 2 Sep 2004 15:46:32 -0000 1.3 *************** *** 608,613 **** if (name[0] == '\"') ! return createPattern(ConstantExp.makeString(new LocatedString( ! name.substring(1,name.length()-1), loc))); if (name[0] == '<' || name[0] == '>') --- 608,613 ---- if (name[0] == '\"') ! return createPattern(createStringConstantExp( ! name.substring(1,name.length()-1))); if (name[0] == '<' || name[0] == '>') *************** *** 626,630 **** if (name.equals("NULL")) ! return createPattern(NullExp.create(loc)); if (name.equals("true") || name.equals("false") ) --- 626,630 ---- if (name.equals("NULL")) ! return createPattern(createNullExp(loc)); if (name.equals("true") || name.equals("false") ) --- NEW FILE: constant.nice --- /**************************************************************************/ /* 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. */ /* */ /**************************************************************************/ /** The 'null' expression. */ public class NullExp extends ConstantExp { isNull() = true; computeType() { // The type needs to be generated each time, since it is polymorphic. } getType() { let alpha = new mlsub.typing.MonotypeVar("any"); return new mlsub.typing.Polytype(new mlsub.typing.Constraint([alpha], null), bossa.syntax.Monotype.maybe(alpha)); } compile() = notNull(gnu.expr.QuoteExp.nullExp); toString() = "null"; } ConstantExp createNullExp(bossa.util.Location loc) { let res = new NullExp(); res.setLocation(loc); return res; } /** The void constant. */ public class VoidConstantExp extends ConstantExp { { this.className = voidName; this.value = gnu.mapping.Values.empty; } toString() = "{}"; } let LocatedString voidName = new LocatedString("void", bossa.util.Location.nowhere()); /** A String constant. */ public class StringConstantExp extends ConstantExp { final String escapedValue; toString() = "\""+escapedValue+"\""; } public ConstantExp createStringConstantExp(String value) { return createStringConstantExp(value, false); } public StringConstantExp createStringConstantExp(String value, boolean multiline) { if (multiline) value = escapeEOL(value); let res = new StringConstantExp(escapedValue: value); res.value = unescapeLiteral(value); res.className = stringClassName; return res; } let LocatedString stringClassName = new LocatedString("java.lang.String", Location.nowhere()); // cf. JLS 3.10.6 public String unescapeLiteral(String s) { let sb = new StringBuffer(); int n = s.length(); for (int i = 0; i < n; i++) { char c = s[i]; if (c == '\\') { i++; char c2 = s[i]; if (c2 == 'b') sb.append('\b'); else if (c2 =='t') sb.append('\t'); else if (c2 =='n') sb.append('\n'); else if (c2 =='f') sb.append('\f'); else if (c2 =='r') sb.append('\r'); else if (c2 =='\"') sb.append('\"'); else if (c2 =='\'') sb.append('\''); else if (c2 =='\\') sb.append('\\'); else { // octal escape int code = int(c2) - int('0'); if (i+1 < n) { int ic3 = int(s[i+1]); if (int('0') <= ic3 <= int('7')) { code = 8*code + (ic3 - int('0')); i++; if (int('0') <= int(c2) <= int('3') && i+1 < n) { // try a last number... int ic4 = int(s[i+1]); if (int('0') <= ic4 <= int('7')) { code = 8*code + (ic4 - int('0')); i++; } } } } sb.append(char(code)); } } else { sb.append(c); } } return sb.toString(); } String escapeEOL(String s) { let sb = new StringBuffer(); int n = s.length(); for (int i = 0; i < n; i++) { char c = s[i]; if (c == '\n') sb.append("\\n"); else if (c == '\r') { sb.append("\\n"); if (s[i+1] == '\n') i++; } else sb.append(c); } return sb.toString(); } /** A type used as an expression. */ public class TypeConstantExp extends ConstantExp { staticClass() { // If this is a '<name>.class' expression, do not consider it as a // qualified prefix. if (isExpression) return null; return cast(value); } void setRepresentedType(mlsub.typing.Polytype type, ?gnu.bytecode.Type bytecodeType) { this.value = bytecodeType; this.representedType = type.getMonotype(); this.type = new mlsub.typing.Polytype (type.getConstraint(), Monotype.sure(new mlsub.typing.MonotypeConstructor (PrimitiveType.classTC, [type.getMonotype()]))); } compile() { if (isLiteral) return super; gnu.bytecode.Type type = cast(value); String representation = type instanceof gnu.bytecode.ArrayType ? type.getSignature().replace('/', '.') : type.getName(); return new gnu.expr.ApplyExp(class_forName, [new gnu.expr.QuoteExp(representation)]); } TypeConstructor getTC() { return nice.tools.typing.Types.rawType(representedType).head(); } ?mlsub.typing.Monotype representedType = null; public boolean isExpression = false; public boolean isLiteral = false; } public TypeConstantExp createTypeConstantExp(LocatedString name) { return new TypeConstantExp(null, null, name, name.toString(), name.location()); } /** @return an Expression representing [root].[name] or a type or package literal if root == null */ Expression createTypeConstantExp(?PackageExp root, LocatedString name) { String fullName = name.toString(); if (root != null) fullName =notNull(root.name).append(".").append(fullName).toString(); ?mlsub.typing.TypeConstructor tc = Node.getGlobalTypeScope().globalLookup(fullName, name.location()); if(tc != null) { gnu.bytecode.Type type = nice.tools.code.Types.javaType(tc); // type might not be a class // for instance if the ident was "int" if (type instanceof gnu.bytecode.ClassType) { TypeConstantExp res = new TypeConstantExp(name); res.setRepresentedType(universalPolytype(tc, true), type); res.setLocation(root == null ? name.location() : root.location()); return res; } } if (root != null) // name has been appended to root's name return root; let res = new PackageExp(fullName); res.setLocation(name.location()); return res; } mlsub.typing.Polytype universalPolytype(mlsub.typing.TypeConstructor tc, boolean sure) { mlsub.typing.MonotypeVar[?] vars = mlsub.typing.MonotypeVar.news(tc.arity()); mlsub.typing.Monotype type = new mlsub.typing.MonotypeConstructor(tc, cast(vars)); return new mlsub.typing.Polytype (vars == null ? null : new mlsub.typing.Constraint(cast(vars), null), sure ? Monotype.sure(type) : Monotype.maybe(type)); } let gnu.bytecode.Method class_forName = gnu.bytecode.ClassType.make("java.lang.Class").getDeclaredMethod("forName", 1); --- TypeConstantExp.java DELETED --- --- NullExp.java DELETED --- --- StringConstantExp.java DELETED --- Index: EnumDefinition.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/EnumDefinition.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** EnumDefinition.java 12 Aug 2004 23:21:41 -0000 1.13 --- EnumDefinition.java 2 Sep 2004 15:46:32 -0000 1.14 *************** *** 98,102 **** super(name, type); List args = new ArrayList(2 + fields.size()); ! args.add(new Arguments.Argument(new StringConstantExp(name.toString()), new LocatedString("name",name.location))); Integer val = new Integer(ordinal); --- 98,102 ---- super(name, type); List args = new ArrayList(2 + fields.size()); ! args.add(new Arguments.Argument(bossa.syntax.dispatch.createStringConstantExp(name.toString()), new LocatedString("name",name.location))); Integer val = new Integer(ordinal); Index: tools.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/tools.nice,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** tools.nice 13 Aug 2004 21:04:41 -0000 1.48 --- tools.nice 2 Sep 2004 15:46:32 -0000 1.49 *************** *** 193,196 **** --- 193,197 ---- GlobalTypeScope getGlobalTypeScope() = native GlobalTypeScope Node.getGlobalTypeScope(); ?gnu.bytecode.ClassType staticClass(Arguments) = native gnu.bytecode.ClassType Arguments.staticClass(); + ?gnu.bytecode.ClassType staticClass(Expression) = native gnu.bytecode.ClassType Expression.staticClass(); List<VarSymbol> findJavaMethods(?gnu.bytecode.ClassType, String, int) = native List JavaClasses.findJavaMethods(gnu.bytecode.ClassType,java.lang.String,int); List<VarSymbol> findJavaMethods(?gnu.bytecode.ClassType, String) = native List JavaClasses.findJavaMethods(gnu.bytecode.ClassType,java.lang.String); Index: dispatch.java.bootstrap =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/dispatch.java.bootstrap,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** dispatch.java.bootstrap 25 Aug 2004 20:49:39 -0000 1.21 --- dispatch.java.bootstrap 2 Sep 2004 15:46:32 -0000 1.22 *************** *** 72,75 **** --- 72,78 ---- { return null; } + public static ConstantExp createStringConstantExp(String value) + { return null; } + static Statement analyse(Statement s, VarScope v, TypeScope t, boolean r) { return null; } Index: ConstantExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/ConstantExp.java,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** ConstantExp.java 5 Aug 2004 19:01:18 -0000 1.51 --- ConstantExp.java 2 Sep 2004 15:46:32 -0000 1.52 *************** *** 274,284 **** } - public static ConstantExp makeString(LocatedString representation) - { - StringConstantExp res = new StringConstantExp(representation.toString()); - res.setLocation(representation.location()); - return res; - } - /**************************************************************** * Booleans --- 274,277 ---- --- VoidConstantExp.java DELETED --- |
From: Arjan B. <ar...@us...> - 2004-09-02 15:46:41
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29818/F:/nice/src/bossa/parser Modified Files: Parser.jj Log Message: Converted constantExp subclasses to Nice code. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.259 retrieving revision 1.260 diff -C2 -d -r1.259 -r1.260 *** Parser.jj 13 Aug 2004 12:52:11 -0000 1.259 --- Parser.jj 2 Sep 2004 15:46:32 -0000 1.260 *************** *** 525,529 **** { name = doted_array_string() ! { return new TypeConstantExp(name); } } --- 525,529 ---- { name = doted_array_string() ! { return bossa.syntax.dispatch.createTypeConstantExp(name); } } *************** *** 1634,1638 **** { t="null" ! { return NullExp.create(makeLocation(t)); } } --- 1634,1638 ---- { t="null" ! { return bossa.syntax.dispatch.createNullExp(makeLocation(t)); } } *************** *** 1677,1693 **** } ! StringConstantExp stringConstantExp(): { String s; } { s=rawString() ! { return new StringConstantExp(s); } } ! StringConstantExp multiLineStringExp(): { Token t; String s; } { t = <MULTILINESTRING> { s = t.image.substring(3, t.image.length() - 3); ! return new StringConstantExp(s, true); } } --- 1677,1693 ---- } ! ConstantExp stringConstantExp(): { String s; } { s=rawString() ! { return bossa.syntax.dispatch.createStringConstantExp(s); } } ! ConstantExp multiLineStringExp(): { Token t; String s; } { t = <MULTILINESTRING> { s = t.image.substring(3, t.image.length() - 3); ! return bossa.syntax.dispatch.createStringConstantExp(s, true); } } *************** *** 2119,2123 **** new LocatedString("0", makeLocation(t))); if (e2 == null) ! e2 = NullExp.create(makeLocation(t)); e1=bossa.syntax.dispatch.createCallExp(symb(t),e1,e2); } --- 2119,2123 ---- new LocatedString("0", makeLocation(t))); if (e2 == null) ! e2 = bossa.syntax.dispatch.createNullExp(makeLocation(t)); e1=bossa.syntax.dispatch.createCallExp(symb(t),e1,e2); } |
From: Francis B. <fb...@us...> - 2004-09-02 13:52:52
|
Update of /cvsroot/nice/Nice/src/nice/tools/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6564/src/nice/tools/doc Modified Files: htmlwriter.nice Log Message: Method names, etc, should now be properly html encoded (eg, < -> <) Index: htmlwriter.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/doc/htmlwriter.nice,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** htmlwriter.nice 2 Sep 2004 12:48:45 -0000 1.15 --- htmlwriter.nice 2 Sep 2004 13:52:41 -0000 1.16 *************** *** 63,67 **** writer.write(getHeader(c.getName().toString())); ! writer.write("<h1>Class " + c.getName() + "</h1>\n"); //Print hierarchy --- 63,67 ---- writer.write(getHeader(c.getName().toString())); ! writer.write("<h1>Class " + htmlEncode(c.getName()) + "</h1>\n"); //Print hierarchy *************** *** 87,91 **** } writer.write("<pre>\n"); ! writer.write(hierarchy); writer.write("</pre>\n"); --- 87,91 ---- } writer.write("<pre>\n"); ! writer.write(htmlEncode(hierarchy)); writer.write("</pre>\n"); *************** *** 96,100 **** writer.write("<ul>\n"); interfaces.foreach(ClassDefinition.Interface i => ! writer.write("<li>" + i.getName() + "</li>\n")); writer.write("</ul>\n"); } --- 96,100 ---- writer.write("<ul>\n"); interfaces.foreach(ClassDefinition.Interface i => ! writer.write("<li>" + htmlEncode(i.getName()) + "</li>\n")); writer.write("</ul>\n"); } *************** *** 105,108 **** --- 105,110 ---- comments = notNull(c.docString()); + //Note: the comments is deliberately not htmlEncoded because I want people + //to be able to put their own html in the comment. Comment c = new Comment(commentStr: comments); List<(?String, String)> tags = c.tags; *************** *** 142,149 **** writer.write(getHeader(gv.getName().toString())); ! writer.write("<h1>Global Variable " + gv.getName() + "</h1>\n"); ! writer.write(htmlSafe(gv.toString())); writer.write("<p>\n"); String comments; --- 144,153 ---- writer.write(getHeader(gv.getName().toString())); ! writer.write("<h1>Global Variable " + htmlEncode(gv.getName()) + "</h1>\n"); ! writer.write(htmlEncode(gv.toString())); + //Note: the comments is deliberately not htmlEncoded because I want people + //to be able to put their own html in the comment. writer.write("<p>\n"); String comments; *************** *** 173,182 **** writer.write(getHeader(m.getName().toString())); ! writer.write("<h1>Method " + m.getName() + "</h1>\n"); ! ! writer.write(htmlSafe(m.toString())); writer.write("<p>\n"); - writer.write("<p>"); String comments; if(m.docString() != null) --- 177,187 ---- writer.write(getHeader(m.getName().toString())); ! writer.write("<h1>Method " + htmlEncode(m.getName()) + "</h1>\n"); + writer.write(htmlEncode(m.toString())); + + //Note: the comments is deliberately not htmlEncoded because I want people + //to be able to put their own html in the comment. writer.write("<p>\n"); String comments; if(m.docString() != null) *************** *** 236,240 **** if(index != s.length()-1) s = s.substring(index+1); ! writer.write("<li><a href='" + escapeFilename(s) + ".html'>" + s + "</a></li>\n"); } writer.write("</ul>\n"); --- 241,245 ---- if(index != s.length()-1) s = s.substring(index+1); ! writer.write("<li><a href='" escapeFilename(s) ".html'>" htmlEncode(s) "</a></li>\n"); } writer.write("</ul>\n"); *************** *** 246,250 **** writer.write("<ul>\n"); for(MethodDeclaration m : methods) { ! writer.write("<li><a href='" escapeFilename(getMethodFilename(m)) ".html'>" m.getName() "</a>" + ": " m.getType() "</li>\n"); } --- 251,255 ---- writer.write("<ul>\n"); for(MethodDeclaration m : methods) { ! writer.write("<li><a href='" escapeFilename(getMethodFilename(m)) ".html'>" htmlEncode(m.getName()) "</a>" + ": " m.getType() "</li>\n"); } *************** *** 257,261 **** writer.write("<ul>\n"); for(GlobalVarDeclaration gv : globalVars) { ! writer.write("<li><a href='gv_" escapeFilename("" gv.getName()) ".html'>" gv.getName() "</a></li>\n"); } writer.write("</ul>\n"); --- 262,266 ---- writer.write("<ul>\n"); for(GlobalVarDeclaration gv : globalVars) { ! writer.write("<li><a href='gv_" escapeFilename("" gv.getName()) ".html'>" htmlEncode(gv.getName()) "</a></li>\n"); } writer.write("</ul>\n"); *************** *** 280,284 **** writer.write("<ul>\n"); for(bossa.modules.Package p : packages) { ! writer.write("<li><a href='" + p.getName().replace('.', "/") + "/index.html'>" + p.getName() + "</a></li>\n"); } writer.write("</ul>\n"); --- 285,289 ---- writer.write("<ul>\n"); for(bossa.modules.Package p : packages) { ! writer.write("<li><a href='" p.getName().replace('.', "/") "/index.html'>" htmlEncode(p.getName()) "</a></li>\n"); } writer.write("</ul>\n"); *************** *** 295,299 **** * although I've made some changes. */ ! String htmlSafe(String s) { StringBuffer sb = new StringBuffer(s.length()); //true if last char was blank - this is for handling non-breaking spaces --- 300,304 ---- * although I've made some changes. */ ! String htmlEncode(String s) { StringBuffer sb = new StringBuffer(s.length()); //true if last char was blank - this is for handling non-breaking spaces *************** *** 352,355 **** --- 357,367 ---- } + /** Convenience method that converts a LocatedString to a String and then htmlEncodes it. + * @param s the string to encode + */ + String htmlEncode(LocatedString s) { + return htmlEncode(s.toString()); + } + /** Returns a string containing everything required up to and including the <body> tag * @param title a String to be displayed in the browser's title bar |
From: Francis B. <fb...@us...> - 2004-09-02 12:52:24
|
Update of /cvsroot/nice/Nice/src/nice/tools/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28698/src/nice/tools/doc Added Files: css.nice Log Message: responsible for writing stylesheets. Currently contains a simple method to output a stylesheet and a the start of a default stylesheet. --- NEW FILE: css.nice --- import java.io.*; /** * Writes a stylesheet to the root folder */ void writeStylesheet() { try { BufferedWriter writer = new BufferedWriter(new FileWriter(new File(outdir, "main.css"))); writer.write(defaultStylesheet); writer.close(); } catch(IOException ioe) { ioe.printStackTrace(); } } /** * Returns the default style sheet as a string. */ var String defaultStylesheet = "/*Default stylesheet for nicedoc*/\n" + "body {\n" + " /*background-color: #003300;*/\n" + "}\n"; |
From: Francis B. <fb...@us...> - 2004-09-02 12:48:55
|
Update of /cvsroot/nice/Nice/src/nice/tools/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28028/src/nice/tools/doc Modified Files: api.nice htmlwriter.nice Log Message: api.nice: runs a command to output a stylesheet. htmlwriter.nice: added stylesheet link to the header, but it needs to link properly to the root directory. Index: htmlwriter.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/doc/htmlwriter.nice,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** htmlwriter.nice 8 Aug 2004 10:16:56 -0000 1.14 --- htmlwriter.nice 2 Sep 2004 12:48:45 -0000 1.15 *************** *** 1,6 **** package nice.tools.doc; - //TODO: change illegal windows filename (+ * etc) - /** --- 1,4 ---- *************** *** 345,349 **** // Not 7 Bit use the unicode system sb.append("&#"); ! sb.append(new Integer(ci).toString()); sb.append(';'); } --- 343,347 ---- // Not 7 Bit use the unicode system sb.append("&#"); ! sb.append(ci); sb.append(';'); } *************** *** 355,362 **** /** Returns a string containing everything required up to and including the <body> tag */ ! String getHeader(String title) { //we could also include some kind of visible header as well //Create a DateFormatter and set the time zone DateFormat df = new SimpleDateFormat("dd/MM/yyyy 'at' HH:mm:ss z"); --- 353,368 ---- /** Returns a string containing everything required up to and including the <body> tag + * @param title a String to be displayed in the browser's title bar + * @param depth the number of levels down we are (required for linking the stylesheet) */ ! String getHeader(String title, int depth) { //we could also include some kind of visible header as well + //if depth is 2, this string will contain "../../" etc, etc + String depthstr = ""; + for(int i = 0; i < depth; i++) { + depthstr += "../"; + } + //Create a DateFormatter and set the time zone DateFormat df = new SimpleDateFormat("dd/MM/yyyy 'at' HH:mm:ss z"); *************** *** 366,374 **** "<head>\n" + "<!-- Generated by nicedoc on " df.format(new Date()) " -->\n" + ! "\t<title>" + title + "</title>\n" + "</head>\n" + "<body>\n"; } /** Returns a string containing everything after and including the </body> tag */ --- 372,385 ---- "<head>\n" + "<!-- Generated by nicedoc on " df.format(new Date()) " -->\n" + ! "\t<title>" title "</title>\n" + ! "\t<link rel=\"stylesheet\" type=\"text/css\" href=\"" depthstr "main.css\" />\n" + "</head>\n" + "<body>\n"; } + String getHeader(String title) { + return getHeader(title, 0); + } + /** Returns a string containing everything after and including the </body> tag */ Index: api.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/doc/api.nice,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** api.nice 14 Mar 2004 14:49:36 -0000 1.3 --- api.nice 2 Sep 2004 12:48:45 -0000 1.4 *************** *** 48,51 **** --- 48,54 ---- d.document(packages); packages.foreach(bossa.modules.Package p => d.document(p)); + + //we also need to write a stylesheet to control the look and feel + writeStylesheet(); } catch (bossa.modules.Exit e) { |
From: Daniel B. <bo...@us...> - 2004-09-01 12:07:29
|
Update of /cvsroot/nice/Nice/testsuite/compiler/classes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32339/testsuite/compiler/classes Modified Files: specialization.testsuite Log Message: Fix classes with less type parameters than a Java parent. Index: specialization.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/classes/specialization.testsuite,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** specialization.testsuite 22 Aug 2004 18:27:18 -0000 1.2 --- specialization.testsuite 1 Sep 2004 12:06:50 -0000 1.3 *************** *** 42,46 **** class C<T,V> extends A<V, String, T> {} ! /// PASS bug /// Toplevel class Foo extends HashMap<String, String> {} --- 42,49 ---- class C<T,V> extends A<V, String, T> {} ! /// PASS ! Foo foo = new Foo(); ! foo["a"] = "1"; ! assert foo["a"].equals("1"); /// Toplevel class Foo extends HashMap<String, String> {} |
From: Daniel B. <bo...@us...> - 2004-09-01 12:07:15
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32339/src/bossa/syntax Modified Files: ClassDefinition.java Log Message: Fix classes with less type parameters than a Java parent. Index: ClassDefinition.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/ClassDefinition.java,v retrieving revision 1.108 retrieving revision 1.109 diff -C2 -d -r1.108 -r1.109 *** ClassDefinition.java 12 Aug 2004 23:21:41 -0000 1.108 --- ClassDefinition.java 1 Sep 2004 12:06:51 -0000 1.109 *************** *** 266,270 **** if (superClassIdent != null) { ! params = resolveParent(superClassIdent, getLocalScope()); superClass = superClassIdent.tc.resolveToTC(typeScope); --- 266,270 ---- if (superClassIdent != null) { ! useInheritanceParams(resolveParams(superClassIdent, getLocalScope())); superClass = superClassIdent.tc.resolveToTC(typeScope); *************** *** 285,292 **** d.resolve(); ! useParent(d, params); ! ! if(d.getImplementation() instanceof PrimitiveType && ! ! (this.getImplementation() instanceof PrimitiveType)) User.error(this, "A class can't extends a primitive"); } --- 285,290 ---- d.resolve(); ! if (d.getImplementation() instanceof PrimitiveType && ! ! (this.getImplementation() instanceof PrimitiveType)) User.error(this, "A class can't extends a primitive"); } *************** *** 577,581 **** { MonotypeConstructor parent = (MonotypeConstructor) i.next(); ! Monotype[] params = resolveParent(parent, getLocalScope()); TypeIdent name = parent.tc; --- 575,580 ---- { MonotypeConstructor parent = (MonotypeConstructor) i.next(); ! ! useInheritanceParams(resolveParams(parent, getLocalScope())); TypeIdent name = parent.tc; *************** *** 585,592 **** { interfaces.add(s); - - ClassDefinition def = ClassDefinition.get((mlsub.typing.Interface) s); - if (def != null) - useParent(def, params); } else --- 584,587 ---- *************** *** 608,612 **** } ! Monotype[] resolveParent(MonotypeConstructor parent, TypeScope typeScope) { if (parent.parameters == null) --- 603,607 ---- } ! Monotype[] resolveParams(MonotypeConstructor parent, TypeScope typeScope) { if (parent.parameters == null) *************** *** 752,761 **** MethodContainer.Constraint specialize(MethodContainer.Constraint our, - MethodContainer.Constraint parent, Monotype[] params) { - if (parent == null) - return null; - if (params == null) return our; --- 747,752 ---- *************** *** 833,841 **** } ! void useParent(MethodContainer parent, Monotype[] params) { if (parentParams == null) classConstraint = ! specialize(this.classConstraint, parent.classConstraint, params); } --- 824,832 ---- } ! void useInheritanceParams(Monotype[] params) { if (parentParams == null) classConstraint = ! specialize(this.classConstraint, params); } |
From: Daniel B. <bo...@us...> - 2004-09-01 11:48:44
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28972 Modified Files: NEWS Log Message: Cleanup. Index: NEWS =================================================================== RCS file: /cvsroot/nice/Nice/NEWS,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** NEWS 1 Sep 2004 10:59:33 -0000 1.45 --- NEWS 1 Sep 2004 11:48:34 -0000 1.46 *************** *** 28,33 **** the index of the last item in a list, which can be used for working with indexes relative to the end of the list, instead of the beginning. ! ! For instance, given a list of ints from 0 to 6 called 'intList': intList[@] is 6, --- 28,33 ---- the index of the last item in a list, which can be used for working with indexes relative to the end of the list, instead of the beginning. ! ! For instance, given a list of ints from 0 to 6 called 'intList': intList[@] is 6, |
From: Arjan B. <ar...@us...> - 2004-09-01 10:59:42
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19968/Nice Modified Files: NEWS Log Message: assert x != null; Index: NEWS =================================================================== RCS file: /cvsroot/nice/Nice/NEWS,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** NEWS 13 Aug 2004 06:24:38 -0000 1.44 --- NEWS 1 Sep 2004 10:59:33 -0000 1.45 *************** *** 9,12 **** --- 9,13 ---- // Here o can be used as a string without cast + The same construct can be used with '!= null' tests. * java.lang.Class is now parameterized by the type it represents. In particular, newInstance is now declared in nice.lang with |