nice-commit Mailing List for The Nice Programming Language (Page 89)
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: <ar...@us...> - 2003-08-09 10:51:50
|
Update of /cvsroot/nice/Nice/testsuite/compiler/statements/loops In directory sc8-pr-cvs1:/tmp/cvs-serv7633/F:/nice/testsuite/compiler/statements/loops Modified Files: newforloop.testsuite Log Message: Type declaration in enhanced for loop is now optional. Index: newforloop.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/statements/loops/newforloop.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** newforloop.testsuite 11 Mar 2003 17:19:28 -0000 1.1 --- newforloop.testsuite 9 Aug 2003 10:51:47 -0000 1.2 *************** *** 30,31 **** --- 30,43 ---- assert(j==10); + /// PASS + String[] arr = ["a","bc","def","ghij","klmno"]; + String t = ""; + for (s : arr) t+=s; + assert(t.equals("abcdefghijklmno")); + + /// PASS + int[][] array2 = [[1,2],[3,4]]; + int j = 0; + for(array3 : array2) + for(i : array3) j+=i; + assert(j==10); |
From: <ag...@us...> - 2003-08-09 03:23:21
|
Update of /cvsroot/nice/eclipse/src/nice/eclipse/ui/wizards In directory sc8-pr-cvs1:/tmp/cvs-serv19849/src/nice/eclipse/ui/wizards Modified Files: _wizards.nice Added Files: NewNiceFileCreationWizard.nice Log Message: syntax highlight proto --- NEW FILE: NewNiceFileCreationWizard.nice --- /**************************************************************************/ /* Nice Eclipse-Plugin */ /* (c) Alex Greif 2003 */ /* */ /* This program is free software; you can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation; either version 2 of the License, or */ /* (at your option) any later version. */ /* */ /**************************************************************************/ package nice.eclipse.ui.wizards; public class NewNiceFileCreationWizard extends Wizard implements INewWizard { NiceFileCreationWizardPage wizardPage = cast(null); IStructuredSelection selection = cast(null); IWorkbench workbench = cast(null); addPages() { wizardPage = new NiceFileCreationWizardPage(workbench: workbench, "niceFileCreationPage", // pageName selection // selection ); this.addPage(wizardPage); } //void init(IWorkbench aWorkbench,IStructuredSelection currentSelection) { init(aWorkbench, currentSelection) { workbench = notNull(aWorkbench); selection = notNull(currentSelection); } performFinish(){ return wizardPage.finish(); } } class NiceFileCreationWizardPage extends WizardNewFileCreationPage //implements SelectionListener { IWorkbench workbench; String pageName = cast(null); IStructuredSelection selection = cast(null); // initializer { this.setTitle("Create Nice File"); this.setDescription("Create a new Nice file resource"); //this.setImageDescriptor(ImageDescriptor.createFromFile(getClass(),"icons/logicbanner.gif")); //$NON-NLS-1$ } validatePage() {return super;} createControl(parentComposite) { super; this.setFileName("untitled.nice"); //$NON-NLS-2$//$NON-NLS-1$ this.setPageComplete(this.validatePage()); } boolean finish() { ?IFile newFile = this.createNewFile(); if (newFile == null) return false; // ie.- creation was unsuccessful // Since the file resource was created fine, open it for editing // iff requested by the user try { ?IWorkbenchWindow dwindow = workbench.getActiveWorkbenchWindow(); if (dwindow != null) { ?IWorkbenchPage page = dwindow.getActivePage(); if (page != null) page.openEditor(newFile); } } catch (org.eclipse.ui.PartInitException e) { e.printStackTrace(); return false; } return true; } } Index: _wizards.nice =================================================================== RCS file: /cvsroot/nice/eclipse/src/nice/eclipse/ui/wizards/_wizards.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** _wizards.nice 1 Aug 2003 20:09:43 -0000 1.1 --- _wizards.nice 9 Aug 2003 03:23:17 -0000 1.2 *************** *** 20,23 **** --- 20,24 ---- import org.eclipse.jface.operation.*; import org.eclipse.jface.viewers.*; + import org.eclipse.jface.wizard.*; import org.eclipse.ui.actions.*; |
From: <ag...@us...> - 2003-08-09 03:23:20
|
Update of /cvsroot/nice/eclipse/src/nice/eclipse/core In directory sc8-pr-cvs1:/tmp/cvs-serv19849/src/nice/eclipse/core Modified Files: _core.nice Log Message: syntax highlight proto Index: _core.nice =================================================================== RCS file: /cvsroot/nice/eclipse/src/nice/eclipse/core/_core.nice,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** _core.nice 6 Aug 2003 12:28:39 -0000 1.2 --- _core.nice 9 Aug 2003 03:23:17 -0000 1.3 *************** *** 33,36 **** --- 33,37 ---- import nice.eclipse.ui.preferences; import nice.eclipse.ui.properties; + import nice.eclipse.ui.editors.syntaxhighlight; import nice.eclipse.core.builder; |
Update of /cvsroot/nice/eclipse/src/nice/eclipse/ui/editors/syntaxhighlight In directory sc8-pr-cvs1:/tmp/cvs-serv19849/src/nice/eclipse/ui/editors/syntaxhighlight Added Files: NiceSourceScanner.nice NiceSourceViewerConfiguration.nice _syntaxhighlight.nice Log Message: syntax highlight proto --- NEW FILE: NiceSourceScanner.nice --- /**************************************************************************/ /* Nice Eclipse-Plugin */ /* (c) Alex Greif 2003 */ /* */ /* This program is free software; you can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation; either version 2 of the License, or */ /* (at your option) any later version. */ /* */ /**************************************************************************/ package nice.eclipse.ui.editors.syntaxhighlight; class AbstractSourceScanner extends BufferedRuleBasedScanner { // initializer { this.initializeRules(); } List<IRule> createRules(); createRules() { return new ArrayList(); } void initializeRules() { this.setRules(this.createRules().toArray()); } } class NiceSourceScanner extends AbstractSourceScanner { createRules() { List<IRule> rules = new ArrayList(); IToken token; // Strings token = getNiceSourceToken(NICE_TEXT_COLOR_STRING); rules.add(new SingleLineRule("'", "'", token)); token = getNiceSourceToken(NICE_TEXT_COLOR_STRING); rules.add(new SingleLineRule("\"", "\"", token)); // Comment token = getNiceSourceToken(NICE_TEXT_COLOR_COMMENT); rules.add(new EndOfLineRule("//", token)); token = getNiceSourceToken(NICE_TEXT_COLOR_COMMENT); rules.add(new MultiLineRule("/*", "*/", token)); // Default token = getNiceSourceToken(NICE_TEXT_COLOR_DEFAULT); this.setDefaultReturnToken(token); WordRule wordRule = new WordRule(new NiceWordDetector(), token); rules.add(wordRule); // Keywords token = getNiceSourceToken(NICE_TEXT_COLOR_KEYWORD); for (String keyword : NICE_KEYWORDS) wordRule.addWord(keyword, token); for (String keyword : NICE_WORD_FRAGMENT_KEYWORDS) rules.add(new NiceWordFragmentPatternRule(keyword, null, token)); return rules; } } public class NiceWordDetector implements IWordDetector { isWordStart(c) { return Character.isLetter(c) || '_' == c; } isWordPart(c) { return Character.isLetterOrDigit(c) || '_' == c; } } /** * This Rule finds Strings independantly where they are in the line. */ class NiceWordFragmentPatternRule extends SingleLineRule { // This method is called if the start-sequence was found. // so we can return true, that means, that the string was found endSequenceDetected(scanner) { return true; } } --- NEW FILE: NiceSourceViewerConfiguration.nice --- /**************************************************************************/ /* Nice Eclipse-Plugin */ /* (c) Alex Greif 2003 */ /* */ /* This program is free software; you can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation; either version 2 of the License, or */ /* (at your option) any later version. */ /* */ /**************************************************************************/ package nice.eclipse.ui.editors.syntaxhighlight; class NiceSourceViewerConfiguration extends SourceViewerConfiguration { getPresentationReconciler(sourceViewer) { PresentationReconciler presReconciler = new PresentationReconciler(); DefaultDamagerRepairer dr = new DefaultDamagerRepairer(new NiceSourceScanner()); presReconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE); presReconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE); return presReconciler; } } --- NEW FILE: _syntaxhighlight.nice --- /**************************************************************************/ /* Nice Eclipse-Plugin */ /* (c) Alex Greif 2003 */ /* */ /* This program is free software; you can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation; either version 2 of the License, or */ /* (at your option) any later version. */ /* */ /**************************************************************************/ package nice.eclipse.ui.editors.syntaxhighlight; import java.util.*; import org.eclipse.jface.text.source.*; import org.eclipse.jface.text.presentation.*; import org.eclipse.jface.text.rules.*; import org.eclipse.jface.text.*; import org.eclipse.swt.*; import org.eclipse.swt.graphics.*; let String NICE_TEXT_COLOR_DEFAULT = "nice_text_color_default"; let String NICE_TEXT_COLOR_COMMENT = "nice_text_color_comment"; let String NICE_TEXT_COLOR_KEYWORD = "nice_text_color_keyword"; let String NICE_TEXT_COLOR_STRING = "nice_text_color_string"; let String[] NICE_KEYWORDS = [ "fun", "static", "final", "transient", "volatile", "const", "let", "extends", "implements", "abstract", "public", "private", "var", "class", "interface", "override", "new", "else", "native", "inline", "import", "package", "alike", "Any", "return", "break", "continue", "super", "try", "catch", "finally", "throw", "instanceof", "requires", "ensures", "assert", "do"]; let String[] NICE_WORD_FRAGMENT_KEYWORDS = [ "@", "!", "=>", "?", "#"]; Token Token(TextAttribute) = native new Token(Object); IToken getNiceSourceToken(String type) { Token newToken = new Token(getNiceSourceTextAttribute(type)); return newToken; } TextAttribute getNiceSourceTextAttribute(String); getNiceSourceTextAttribute(type) { return getNiceSourceTextAttribute(NICE_TEXT_COLOR_DEFAULT); } getNiceSourceTextAttribute(NICE_TEXT_COLOR_DEFAULT) { return new TextAttribute(new Color(org.eclipse.swt.widgets.Display.getCurrent(), new RGB(0,0,0)), null, SWT.NORMAL); } getNiceSourceTextAttribute(NICE_TEXT_COLOR_COMMENT) { return new TextAttribute(new Color(org.eclipse.swt.widgets.Display.getCurrent(), new RGB(255,0,0)), null, SWT.NORMAL); } getNiceSourceTextAttribute(NICE_TEXT_COLOR_KEYWORD) { return new TextAttribute(new Color(org.eclipse.swt.widgets.Display.getCurrent(), new RGB(0,0,255)), null, SWT.NORMAL); } getNiceSourceTextAttribute(NICE_TEXT_COLOR_STRING) { return new TextAttribute(new Color(org.eclipse.swt.widgets.Display.getCurrent(), new RGB(100,100,100)), null, SWT.NORMAL); } |
From: <ag...@us...> - 2003-08-09 03:23:20
|
Update of /cvsroot/nice/eclipse/src In directory sc8-pr-cvs1:/tmp/cvs-serv19849/src Modified Files: plugin.xml Log Message: syntax highlight proto Index: plugin.xml =================================================================== RCS file: /cvsroot/nice/eclipse/src/plugin.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** plugin.xml 6 Aug 2003 19:59:37 -0000 1.4 --- plugin.xml 9 Aug 2003 03:23:17 -0000 1.5 *************** *** 54,58 **** <wizard id="net.sf.nice.new_nice_project_creation_wizard" ! name="NewNiceProject.label" class="nice.eclipse.ui.wizards.NewProjectCreationWizard" category="net.sf.nice.nice_wizard_category" --- 54,58 ---- <wizard id="net.sf.nice.new_nice_project_creation_wizard" ! name="Nice Project" class="nice.eclipse.ui.wizards.NewProjectCreationWizard" category="net.sf.nice.nice_wizard_category" *************** *** 62,66 **** icon="icons/full/ctool16/newjprj_wiz.gif"> <description>NewNiceProject.description</description> ! </wizard> </extension> --- 62,74 ---- icon="icons/full/ctool16/newjprj_wiz.gif"> <description>NewNiceProject.description</description> ! </wizard> ! <wizard ! id="net.sf.nice.new_nice_file_creation_wizard" ! name="Nice Source File" ! class="nice.eclipse.ui.wizards.NewNiceFileCreationWizard" ! category="net.sf.nice.nice_wizard_category" ! icon="icons/full/ctool16/newclass_wiz.gif"> ! <description>Create a Nice File</description> ! </wizard> </extension> *************** *** 102,110 **** <editor name="Nice Editor" icon="icons/full/ctool16/nice_page.gif" extensions="nice" class="nice.eclipse.ui.editors.NiceFileEditor" ! id="net.sf.nice.nice_file_editor"> ! <!--contributorClass="net.sf.nice.internal.ui.niceeditor.NiceEditorActionContributor"--> </editor> </extension> --- 110,120 ---- <editor name="Nice Editor" + default="true" icon="icons/full/ctool16/nice_page.gif" extensions="nice" class="nice.eclipse.ui.editors.NiceFileEditor" ! id="net.sf.nice.nice_file_editor" ! > ! <!--contributorClass="net.sf.nice.ui.editors.NiceEditorActionContributor"--> </editor> </extension> |
From: <ag...@us...> - 2003-08-09 03:23:20
|
Update of /cvsroot/nice/eclipse/src/nice/eclipse/ui/editors In directory sc8-pr-cvs1:/tmp/cvs-serv19849/src/nice/eclipse/ui/editors Modified Files: NiceFileEditor.nice _editors.nice Log Message: syntax highlight proto Index: NiceFileEditor.nice =================================================================== RCS file: /cvsroot/nice/eclipse/src/nice/eclipse/ui/editors/NiceFileEditor.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NiceFileEditor.nice 1 Aug 2003 20:09:43 -0000 1.1 --- NiceFileEditor.nice 9 Aug 2003 03:23:17 -0000 1.2 *************** *** 16,21 **** --- 16,26 ---- class NiceFileEditor extends TextEditor { + + setSourceViewerConfiguration(sourceViewerConfiguration) {super;} + + initializeEditor() { this.configurePreferenceStore(); + this.setSourceViewerConfiguration(new NiceSourceViewerConfiguration()); } *************** *** 32,34 **** --- 37,58 ---- } + + + + + + + + + + + + + + + + + + + Index: _editors.nice =================================================================== RCS file: /cvsroot/nice/eclipse/src/nice/eclipse/ui/editors/_editors.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** _editors.nice 1 Aug 2003 20:09:43 -0000 1.1 --- _editors.nice 9 Aug 2003 03:23:17 -0000 1.2 *************** *** 19,22 **** --- 19,23 ---- import nice.eclipse.core; + import nice.eclipse.ui.editors.syntaxhighlight; |
From: <ag...@us...> - 2003-08-09 03:23:19
|
Update of /cvsroot/nice/eclipse In directory sc8-pr-cvs1:/tmp/cvs-serv19849 Modified Files: build.xml Log Message: syntax highlight proto Index: build.xml =================================================================== RCS file: /cvsroot/nice/eclipse/build.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** build.xml 6 Aug 2003 20:55:09 -0000 1.8 --- build.xml 9 Aug 2003 03:23:16 -0000 1.9 *************** *** 37,41 **** <property name="plugin.id" value="net.sf.nice"/> ! <property name="plugin.version" value="0.1.7"/> <property name="plugin.id.version" value="${plugin.id}_${plugin.version}"/> <property name="plugin.dir" value="${build.dir}/${plugin.id.version}"/> --- 37,41 ---- <property name="plugin.id" value="net.sf.nice"/> ! <property name="plugin.version" value="0.1.8"/> <property name="plugin.id.version" value="${plugin.id}_${plugin.version}"/> <property name="plugin.dir" value="${build.dir}/${plugin.id.version}"/> |
From: <ag...@us...> - 2003-08-09 03:21:34
|
Update of /cvsroot/nice/eclipse/src/nice/eclipse/ui/editors/syntaxhighlight In directory sc8-pr-cvs1:/tmp/cvs-serv19713/src/nice/eclipse/ui/editors/syntaxhighlight Log Message: Directory /cvsroot/nice/eclipse/src/nice/eclipse/ui/editors/syntaxhighlight added to the repository |
From: <ar...@us...> - 2003-08-08 21:48:01
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1:/tmp/cvs-serv10304/F:/nice/src/bossa/parser Modified Files: Parser.jj Log Message: Type declaration in enhanced for loop is now optional. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.202 retrieving revision 1.203 diff -C2 -d -r1.202 -r1.203 *** Parser.jj 31 Jul 2003 18:45:35 -0000 1.202 --- Parser.jj 8 Aug 2003 21:47:58 -0000 1.203 *************** *** 2445,2448 **** --- 2445,2450 ---- "for" "(" ( + LOOKAHEAD( <IDENT> ":" ) loop=ForInStatement() + | LOOKAHEAD( monotype() <IDENT> ":" ) loop=ForInStatement() | ( *************** *** 2466,2472 **** Statement ForInStatement() : ! { Statement body; Monotype vartype; LocatedString var; Expression container; Token t; } { ! vartype=monotype() var=ident() t=":" container=Expression() ")" body=Statement() { return LoopStmt.forInLoop(vartype,var,Location.make(t),container,body); } --- 2468,2479 ---- Statement ForInStatement() : ! { Statement body; Monotype vartype = null; LocatedString var; Expression container; Token t; } { ! ( ! LOOKAHEAD( <IDENT> ":") var=ident() ! | ! vartype=monotype() var=ident() ! ) ! t=":" container=Expression() ")" body=Statement() { return LoopStmt.forInLoop(vartype,var,Location.make(t),container,body); } |
From: <ar...@us...> - 2003-08-08 21:48:01
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv10304/F:/nice/src/bossa/syntax Modified Files: LoopStmt.java Log Message: Type declaration in enhanced for loop is now optional. Index: LoopStmt.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/LoopStmt.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** LoopStmt.java 24 Jun 2003 15:28:19 -0000 1.16 --- LoopStmt.java 8 Aug 2003 21:47:57 -0000 1.17 *************** *** 44,57 **** public static Statement forInLoop(Monotype vartype, LocatedString var, Location loc, Expression container, Statement body) { ! Monotype itertype; LocatedString iter; Expression getiter,iterexp,cond,getvar; Statement loop,init,assign; ! List tparams = new ArrayList(1); ! tparams.add(vartype); ! itertype = new MonotypeConstructor(new TypeIdent(new LocatedString("Iterator", loc)), new TypeParameters(tparams), loc); ! itertype.nullness = Monotype.sure; getiter = CallExp.create(new IdentExp(new LocatedString("forIterator", loc)), container); iter = new LocatedString(loc.uniqueIdentifier("for_in_iter_"), loc); --- 44,61 ---- public static Statement forInLoop(Monotype vartype, LocatedString var, Location loc, Expression container, Statement body) { ! Monotype itertype = null; LocatedString iter; Expression getiter,iterexp,cond,getvar; Statement loop,init,assign; ! if (vartype != null) ! { ! List tparams = new ArrayList(1); ! tparams.add(vartype); ! itertype = new MonotypeConstructor(new TypeIdent(new LocatedString("Iterator", loc)), new TypeParameters(tparams), loc); ! itertype.nullness = Monotype.sure; ! } ! getiter = CallExp.create(new IdentExp(new LocatedString("forIterator", loc)), container); iter = new LocatedString(loc.uniqueIdentifier("for_in_iter_"), loc); |
From: <ar...@us...> - 2003-08-08 21:48:01
|
Update of /cvsroot/nice/Nice/debian In directory sc8-pr-cvs1:/tmp/cvs-serv10304/F:/nice/debian Modified Files: changelog Log Message: Type declaration in enhanced for loop is now optional. Index: changelog =================================================================== RCS file: /cvsroot/nice/Nice/debian/changelog,v retrieving revision 1.194 retrieving revision 1.195 diff -C2 -d -r1.194 -r1.195 *** changelog 8 Aug 2003 20:15:09 -0000 1.194 --- changelog 8 Aug 2003 21:47:58 -0000 1.195 *************** *** 23,26 **** --- 23,30 ---- * Package-level constants and variables are now automatically initialized in the correct order when they directly depend on each other. + * The type declaration in the enhanced forloop is now optional but only if + the type is inferable. + int[] array = [1,2,3,4,5]; + for (elem : array) println(elem); * Bugfixes (parameter's default value refering to previous parameters, ...) |
From: <bo...@us...> - 2003-08-08 20:15:11
|
Update of /cvsroot/nice/Nice/debian In directory sc8-pr-cvs1:/tmp/cvs-serv28554/debian Modified Files: changelog Log Message: Bugfixes. Index: changelog =================================================================== RCS file: /cvsroot/nice/Nice/debian/changelog,v retrieving revision 1.193 retrieving revision 1.194 diff -C2 -d -r1.193 -r1.194 *** changelog 8 Aug 2003 20:13:07 -0000 1.193 --- changelog 8 Aug 2003 20:15:09 -0000 1.194 *************** *** 23,26 **** --- 23,27 ---- * Package-level constants and variables are now automatically initialized in the correct order when they directly depend on each other. + * Bugfixes (parameter's default value refering to previous parameters, ...) -- |
From: <bo...@us...> - 2003-08-08 20:13:10
|
Update of /cvsroot/nice/Nice/debian In directory sc8-pr-cvs1:/tmp/cvs-serv28230/debian Modified Files: changelog Log Message: Package-level constants and variables are now automatically initialized in the correct order when they directly depend on each other. Index: changelog =================================================================== RCS file: /cvsroot/nice/Nice/debian/changelog,v retrieving revision 1.192 retrieving revision 1.193 diff -C2 -d -r1.192 -r1.193 *** changelog 31 Jul 2003 18:45:35 -0000 1.192 --- changelog 8 Aug 2003 20:13:07 -0000 1.193 *************** *** 21,24 **** --- 21,26 ---- } } + * Package-level constants and variables are now automatically initialized + in the correct order when they directly depend on each other. -- |
From: <bo...@us...> - 2003-08-08 19:16:36
|
Update of /cvsroot/nice/Nice/src/bossa/modules In directory sc8-pr-cvs1:/tmp/cvs-serv18726/src/bossa/modules Modified Files: Package.java Log Message: Fixed default values of optional parameters refering to a previous one, when the function is imported from a compiled package. Fixed nested calls to such functions. Index: Package.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/modules/Package.java,v retrieving revision 1.95 retrieving revision 1.96 diff -C2 -d -r1.95 -r1.96 *** Package.java 17 Jul 2003 23:10:37 -0000 1.95 --- Package.java 8 Aug 2003 19:16:33 -0000 1.96 *************** *** 724,735 **** if the package has not been recompiled. */ ! public gnu.expr.Expression lookupPackageMethod(String methodName, String type) { ! Method res = lookupClassMethod(source.getBytecode(), methodName, ! "type", type); if (res == null) return null; ! return new gnu.expr.QuoteExp(new gnu.expr.PrimProcedure(res)); } --- 724,738 ---- if the package has not been recompiled. */ ! public gnu.expr.Expression lookupPackageMethod(ToplevelFunction fun) { ! Method res = lookupClassMethod(source.getBytecode(), ! fun.getName().toString(), ! "type", fun.getType().toString()); if (res == null) return null; ! return new gnu.expr.QuoteExp ! (new gnu.expr.PrimProcedure ! (res, fun.formalParameters().getParameterCopies())); } *************** *** 797,800 **** --- 800,804 ---- res = nice.tools.code.Gen.createMethod (name, argTypes, retType, def.getSymbols()); + res.parameterCopies = def.formalParameters().getParameterCopies(); // add unique information to disambiguate which method this represents |
From: <bo...@us...> - 2003-08-08 19:16:36
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv18726/src/bossa/syntax Modified Files: ToplevelFunction.java Module.java FormalParameters.java Log Message: Fixed default values of optional parameters refering to a previous one, when the function is imported from a compiled package. Fixed nested calls to such functions. Index: ToplevelFunction.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/ToplevelFunction.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ToplevelFunction.java 26 Jul 2003 22:02:01 -0000 1.18 --- ToplevelFunction.java 8 Aug 2003 19:16:33 -0000 1.19 *************** *** 148,153 **** // Just get the handle to the already compiled function. ! gnu.expr.Expression res = module.lookupPackageMethod ! (name.toString(), getType().toString()); if (res != null) --- 148,152 ---- // Just get the handle to the already compiled function. ! gnu.expr.Expression res = module.lookupPackageMethod(this); if (res != null) *************** *** 160,163 **** --- 159,163 ---- LambdaExp code = Gen.createMethod (name.toString(), javaArgTypes(), javaReturnType(), getSymbols()); + code.parameterCopies = parameters.getParameterCopies(); code.addBytecodeAttribute (new MiscAttr("type", getType().toString().getBytes())); Index: Module.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Module.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Module.java 30 Apr 2003 19:39:04 -0000 1.14 --- Module.java 8 Aug 2003 19:16:33 -0000 1.15 *************** *** 32,36 **** gnu.expr.Declaration addGlobalVar(String name, gnu.bytecode.Type type, boolean constant); gnu.expr.Expression getDispatchMethod(NiceMethod def); ! gnu.expr.Expression lookupPackageMethod(String methodName, String type); gnu.expr.ReferenceExp addMethod(gnu.expr.LambdaExp method, boolean packageMethod); --- 32,36 ---- gnu.expr.Declaration addGlobalVar(String name, gnu.bytecode.Type type, boolean constant); gnu.expr.Expression getDispatchMethod(NiceMethod def); ! gnu.expr.Expression lookupPackageMethod(ToplevelFunction fun); gnu.expr.ReferenceExp addMethod(gnu.expr.LambdaExp method, boolean packageMethod); Index: FormalParameters.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/FormalParameters.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** FormalParameters.java 31 Jul 2003 23:40:23 -0000 1.30 --- FormalParameters.java 8 Aug 2003 19:16:33 -0000 1.31 *************** *** 107,116 **** { if (state == ARGUMENT_REFERENCE) ! captured = true; return state; } ! private boolean captured = false; public void setDeclaration (gnu.expr.Declaration declaration, --- 107,118 ---- { if (state == ARGUMENT_REFERENCE) ! // This parameter is referenced by a later one. ! // We will need to copy its value. ! copies = new java.util.Stack(); return state; } ! private java.util.Stack copies; public void setDeclaration (gnu.expr.Declaration declaration, *************** *** 118,124 **** { super.setDeclaration(declaration, isThis); - - if (captured) - getDeclaration().mustCopyValue(true); } } --- 120,123 ---- *************** *** 137,141 **** public gnu.expr.Expression compile () { ! return new gnu.expr.CopyArgument(this.getSymbol().getDeclaration()); } } --- 136,140 ---- public gnu.expr.Expression compile () { ! return new gnu.expr.CopyArgument(((Symbol) this.getSymbol()).copies); } } *************** *** 504,507 **** --- 503,524 ---- } } + return res; + } + + public java.util.Stack[] getParameterCopies() + { + java.util.Stack[] res = null; + + for(int i = 0; i < size; i++) + { + Parameter param = parameters[i]; + if (param.symbol.copies != null) + { + if (res == null) + res = new java.util.Stack[parameters.length]; + res[i] = param.symbol.copies; + } + } + return res; } |
From: <bo...@us...> - 2003-08-08 19:16:36
|
Update of /cvsroot/nice/Nice/src/gnu/expr In directory sc8-pr-cvs1:/tmp/cvs-serv18726/src/gnu/expr Modified Files: PrimProcedure.java LambdaExp.java Declaration.java CopyArgument.java Log Message: Fixed default values of optional parameters refering to a previous one, when the function is imported from a compiled package. Fixed nested calls to such functions. Index: PrimProcedure.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/PrimProcedure.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PrimProcedure.java 17 Jun 2003 12:06:02 -0000 1.7 --- PrimProcedure.java 8 Aug 2003 19:16:32 -0000 1.8 *************** *** 184,187 **** --- 184,195 ---- } + public PrimProcedure(Method method, java.util.Stack[] parameterCopies) + { + init(method); + this.parameterCopies = parameterCopies; + } + + private java.util.Stack[] parameterCopies; + public PrimProcedure(Method method, Interpreter interpreter) { *************** *** 308,311 **** --- 316,329 ---- public final Type[] getParameterTypes() { return argTypes; } + public static void compileArgs(Expression[] args, + Type thisType, Type[] argTypes, + boolean variable, + String name, LambdaExp source, + Compilation comp) + { + compileArgs(args, thisType, argTypes, variable, name, source, comp, + source == null ? null : source.parameterCopies); + } + /** Compile arguments and push unto stack. * @param args arguments to evaluate and push. *************** *** 320,324 **** boolean variable, String name, LambdaExp source, ! Compilation comp) { Type arg_type = null; --- 338,343 ---- boolean variable, String name, LambdaExp source, ! Compilation comp, ! java.util.Stack[] parameterCopies) { Type arg_type = null; *************** *** 331,335 **** Declaration argDecl = source == null ? null : source.firstDecl(); ! Scope scope = code.pushScope(); for (int i = 0; ; ++i) --- 350,358 ---- Declaration argDecl = source == null ? null : source.firstDecl(); ! Scope scope; ! if (parameterCopies == null) ! scope = null; ! else ! scope = code.pushScope(); for (int i = 0; ; ++i) *************** *** 365,372 **** : CheckedTarget.getInstance(arg_type, source, i); args[i].compileNotePosition(comp, target); ! if (argDecl != null && argDecl.mustCopyValue()) { ! Variable value = scope.addVariable(code, target.getType(), argDecl.getName()); ! argDecl.setCopyVariable(value); code.emitDup(); code.emitStore(value); --- 388,398 ---- : CheckedTarget.getInstance(arg_type, source, i); args[i].compileNotePosition(comp, target); ! if (parameterCopies != null && parameterCopies[i] != null) { ! Variable value = scope.addVariable(code, target.getType(), ! argDecl != null ! ? argDecl.getName() ! : "l_" + i); ! parameterCopies[i].push(value); code.emitDup(); code.emitStore(value); *************** *** 377,381 **** argDecl = argDecl.nextDecl(); } ! code.popScope(); } --- 403,416 ---- argDecl = argDecl.nextDecl(); } ! ! // Restore the state of the captured parameters, ! // so that a subsequent after a nested call use is possible. ! if (parameterCopies != null) ! for (int i = 0; i < arg_count; i++) ! if (parameterCopies[i] != null) ! parameterCopies[i].pop(); ! ! if (scope != null) ! code.popScope(); } *************** *** 403,407 **** gnu.bytecode.CodeAttr code = comp.getCode(); compileArgs(args, thisType, argTypes, ! takesVarArgs(), getName(), source, comp); if (method == null) --- 438,442 ---- gnu.bytecode.CodeAttr code = comp.getCode(); compileArgs(args, thisType, argTypes, ! takesVarArgs(), getName(), source, comp, parameterCopies); if (method == null) Index: LambdaExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/LambdaExp.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** LambdaExp.java 18 Apr 2003 14:50:19 -0000 1.16 --- LambdaExp.java 8 Aug 2003 19:16:32 -0000 1.17 *************** *** 31,34 **** --- 31,36 ---- public Expression[] defaultArgs; + public java.util.Stack[] parameterCopies; + static int counter; /** Unique id number, to ease print-outs and debugging. */ Index: Declaration.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/Declaration.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Declaration.java 1 May 2003 22:43:34 -0000 1.10 --- Declaration.java 8 Aug 2003 19:16:33 -0000 1.11 *************** *** 601,621 **** return null; } - - /**************************************************************** - * Support for referencing the value of a previous argument in a call. - ****************************************************************/ - - public void mustCopyValue(boolean value) - { - mustCopyValue = true; - } - - boolean mustCopyValue() { return mustCopyValue; } - - private boolean mustCopyValue; - - void setCopyVariable(Variable var) { this.copyVariable = var; } - Variable getCopyVariable() { return copyVariable; } - - private Variable copyVariable; } --- 601,603 ---- Index: CopyArgument.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/CopyArgument.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CopyArgument.java 28 Nov 2002 12:14:42 -0000 1.2 --- CopyArgument.java 8 Aug 2003 19:16:33 -0000 1.3 *************** *** 25,36 **** public class CopyArgument extends Expression { ! public CopyArgument (Declaration argument) { ! this.argument = argument; } public void compile(gnu.expr.Compilation comp, gnu.expr.Target target) { ! gnu.bytecode.Variable value = argument.getCopyVariable(); comp.getCode().emitLoad(value); target.compileFromStack(comp, value.getType()); --- 25,36 ---- public class CopyArgument extends Expression { ! public CopyArgument (java.util.Stack copies) { ! this.copies = copies; } public void compile(gnu.expr.Compilation comp, gnu.expr.Target target) { ! gnu.bytecode.Variable value = (gnu.bytecode.Variable) copies.peek(); comp.getCode().emitLoad(value); target.compileFromStack(comp, value.getType()); *************** *** 40,43 **** {} ! Declaration argument; } --- 40,43 ---- {} ! final java.util.Stack copies; } |
From: <bo...@us...> - 2003-08-08 19:16:34
|
Update of /cvsroot/nice/Nice/testsuite/compiler/methods In directory sc8-pr-cvs1:/tmp/cvs-serv18726/testsuite/compiler/methods Modified Files: optionalParameters.testsuite Log Message: Fixed default values of optional parameters refering to a previous one, when the function is imported from a compiled package. Fixed nested calls to such functions. Index: optionalParameters.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/methods/optionalParameters.testsuite,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** optionalParameters.testsuite 26 May 2003 20:52:26 -0000 1.7 --- optionalParameters.testsuite 8 Aug 2003 19:16:31 -0000 1.8 *************** *** 162,163 **** --- 162,183 ---- int i; } + + /// PASS + /// package a + /// Toplevel + int foo(int x = 1, int y = x + 1) = x + y; + /// package b import a + assert foo(2) == 5; + + /// PASS + /// package a + /// Toplevel + int foo(int x = 1, int y = x + 1); + foo(x, y) = x + y; + /// package b import a + assert foo(2) == 5; + + /// PASS + assert foo(x: 1, y: foo()) == 1; + /// Toplevel + int foo(int x = 0, int y = x + 1, int z = x) = z; |
From: <bo...@us...> - 2003-08-08 11:12:55
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv2372/src/bossa/syntax Modified Files: Pattern.java MethodBodyDefinition.java Log Message: Resolve globals in patterns after the global resolution phase, so that their value and type is known. Index: Pattern.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Pattern.java,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** Pattern.java 8 Aug 2003 06:04:53 -0000 1.67 --- Pattern.java 8 Aug 2003 11:12:53 -0000 1.68 *************** *** 154,158 **** } ! void resolveGlobalConstants(VarScope scope, TypeScope typeScope) { if (refName != null) --- 154,158 ---- } ! void resolveGlobalConstants() { if (refName != null) *************** *** 188,192 **** NewExp val = (NewExp)symbol.getValue(); - symbol.getDefinition().resolve(); tc = val.tc; atValue = new ConstantExp(null, tc, symbol, --- 188,191 ---- *************** *** 221,225 **** } else ! User.error(name, "The value of " + name + "can't be used as pattern"); } --- 220,224 ---- } else ! User.error(name, "The value of " + name + " can't be used as pattern"); } *************** *** 227,232 **** { for(int i = 0; i < patterns.length; i++) { - patterns[i].resolveGlobalConstants(vscope, tscope); patterns[i].resolveTC(tscope); } } --- 226,237 ---- { for(int i = 0; i < patterns.length; i++) { patterns[i].resolveTC(tscope); + } + } + + static void resolveValues(Pattern[] patterns) + { + for(int i = 0; i < patterns.length; i++) { + patterns[i].resolveGlobalConstants(); } } Index: MethodBodyDefinition.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MethodBodyDefinition.java,v retrieving revision 1.137 retrieving revision 1.138 diff -C2 -d -r1.137 -r1.138 *** MethodBodyDefinition.java 27 Jul 2003 13:28:49 -0000 1.137 --- MethodBodyDefinition.java 8 Aug 2003 11:12:53 -0000 1.138 *************** *** 327,330 **** --- 327,332 ---- void lateBuildScope() { + Pattern.resolveValues(formals); + VarSymbol s = findSymbol(scope); |
From: <bo...@us...> - 2003-08-08 10:18:48
|
Update of /cvsroot/nice/Nice/testsuite/compiler/methods In directory sc8-pr-cvs1:/tmp/cvs-serv27809/testsuite/compiler/methods Modified Files: globalconstant.testsuite Log Message: Moved testcase from globalVariables. Checks that a dispatch on a global is typechecked. Index: globalconstant.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/methods/globalconstant.testsuite,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** globalconstant.testsuite 7 Jul 2003 18:27:11 -0000 1.6 --- globalconstant.testsuite 8 Aug 2003 10:18:45 -0000 1.7 *************** *** 124,125 **** --- 124,141 ---- foo(n) {} foo(n>xyz) {} + + + /// PASS + assert foo(END_OF_TIME); + /// Toplevel + let Date END_OF_TIME = new Date(Long.MAX_VALUE); + boolean foo(Date d); + foo(d) = false; + foo(END_OF_TIME) = true; + + /// FAIL + /// Toplevel + boolean foo(String d); + foo(d) = false; + foo(END_OF_TIME) = true; + let Date END_OF_TIME = new Date(Long.MAX_VALUE); |
From: <bo...@us...> - 2003-08-08 10:17:34
|
Update of /cvsroot/nice/Nice/testsuite/compiler In directory sc8-pr-cvs1:/tmp/cvs-serv27675/testsuite/compiler Modified Files: globalVariables.testsuite Log Message: Moved testcase to methods/globalconstant. Index: globalVariables.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/globalVariables.testsuite,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** globalVariables.testsuite 8 Aug 2003 06:04:53 -0000 1.11 --- globalVariables.testsuite 8 Aug 2003 10:17:32 -0000 1.12 *************** *** 143,152 **** class QualifiedName { String a; String b; } - - /// PASS - assert foo(END_OF_TIME); - /// Toplevel - let Date END_OF_TIME = new Date(Long.MAX_VALUE); - boolean foo(Date d); - foo(d) = false; - foo(END_OF_TIME) = true; --- 143,144 ---- |
From: <ar...@us...> - 2003-08-08 06:04:56
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv22071/F:/nice/src/bossa/syntax Modified Files: Pattern.java Log Message: fix of bug #785175. Index: Pattern.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Pattern.java,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** Pattern.java 24 Jul 2003 17:52:08 -0000 1.66 --- Pattern.java 8 Aug 2003 06:04:53 -0000 1.67 *************** *** 216,220 **** NewExp val = (NewExp)symbol.getValue(); - symbol.getDefinition().resolve(); tc = val.tc; atValue = new ConstantExp(null, tc, symbol, --- 216,219 ---- |
From: <ar...@us...> - 2003-08-08 06:04:56
|
Update of /cvsroot/nice/Nice/testsuite/compiler In directory sc8-pr-cvs1:/tmp/cvs-serv22071/F:/nice/testsuite/compiler Modified Files: globalVariables.testsuite Log Message: fix of bug #785175. Index: globalVariables.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/globalVariables.testsuite,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** globalVariables.testsuite 31 Jul 2003 21:59:39 -0000 1.10 --- globalVariables.testsuite 8 Aug 2003 06:04:53 -0000 1.11 *************** *** 144,145 **** --- 144,152 ---- class QualifiedName { String a; String b; } + /// PASS + assert foo(END_OF_TIME); + /// Toplevel + let Date END_OF_TIME = new Date(Long.MAX_VALUE); + boolean foo(Date d); + foo(d) = false; + foo(END_OF_TIME) = true; |
From: <bo...@us...> - 2003-08-07 23:58:16
|
Update of /cvsroot/nice/Nice/src/nice/tools/compiler In directory sc8-pr-cvs1:/tmp/cvs-serv4133/src/nice/tools/compiler Modified Files: .cvsignore Log Message: Added Manifest. Index: .cvsignore =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/compiler/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .cvsignore 11 Jun 2003 22:35:08 -0000 1.2 --- .cvsignore 7 Aug 2003 23:58:13 -0000 1.3 *************** *** 1,2 **** --- 1,3 ---- + Manifest console.jar dateBuild.nice |
From: <bo...@us...> - 2003-08-07 10:20:26
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv8812/src/bossa/syntax Modified Files: JavaClasses.java Log Message: Catch more errors when an imported Java class refers to other classes that are not in the classpath. Index: JavaClasses.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/JavaClasses.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** JavaClasses.java 30 Apr 2003 11:30:52 -0000 1.34 --- JavaClasses.java 7 Aug 2003 10:20:23 -0000 1.35 *************** *** 296,323 **** try{ classType.addMethods(); ! } ! catch(NoClassDefFoundError e){ ! User.warning("Class " + e.getMessage().replace('/','.') + ! " was not found.\n" + ! "It is refered to in class " + classType.getName() + ! "\nYou probably need to install the corresponding package."); ! } ! catch (ClassFormatError e) { ! User.warning("Class " + classType.getName() + ! " has an invalid bytecode format"); ! } ! ! for (Field f = classType.getFields(); f != null; f = f.getNext()) ! { if (retyped.get(f) == null) addSymbol(f, JavaFieldAccess.make(f)); - } ! for(Method m = classType.getMethods(); m!=null; m = m.getNext()) ! { if(m.isConstructor()) { JavaMethod res = JavaMethod.make(m, true); ! if (res != null) TypeConstructors.addConstructor(tc, res); --- 296,309 ---- try{ classType.addMethods(); ! ! for (Field f = classType.getFields(); f != null; f = f.getNext()) if (retyped.get(f) == null) addSymbol(f, JavaFieldAccess.make(f)); ! for (Method m = classType.getMethods(); m!=null; m = m.getNext()) if(m.isConstructor()) { JavaMethod res = JavaMethod.make(m, true); ! if (res != null) TypeConstructors.addConstructor(tc, res); *************** *** 346,350 **** } } ! } } --- 332,346 ---- } } ! } ! catch(NoClassDefFoundError e){ ! User.warning("Class " + e.getMessage().replace('/','.') + ! " was not found.\n" + ! "It is refered to in class " + classType.getName() + ! "\nYou probably need to install the corresponding package."); ! } ! catch (ClassFormatError e) { ! User.warning("Class " + classType.getName() + ! " has an invalid bytecode format"); ! } } |
From: <bo...@us...> - 2003-08-07 09:56:40
|
Update of /cvsroot/nice/Nice/src/nice/tools/ant In directory sc8-pr-cvs1:/tmp/cvs-serv5231/src/nice/tools/ant Modified Files: Nicec.java Log Message: Use the project's base dir as the current directory during the compilation, so that relative entries in sourcepath and classpath work even when the base dir is not the current directory. This case happens in particular when ant is called by eclipse, and probably also if basedir is given explicitely. The old value of the current directory is always restored at the end. Index: Nicec.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/ant/Nicec.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Nicec.java 11 Jun 2003 22:24:06 -0000 1.18 --- Nicec.java 7 Aug 2003 09:56:37 -0000 1.19 *************** *** 282,316 **** public void execute() throws BuildException { log("runtime: " + runtime, Project.MSG_VERBOSE); ! nice.tools.compiler.console.ConsoleOutput console = ! nice.tools.compiler.console.fun.consoleOutput(); ! Compilation compilation = bossa.modules.fun.createCompilation(console); ! if (sourcepath != null) ! compilation.sourcePath = sourcepath; ! if (destination != null) ! compilation.destinationDir = destination.getAbsolutePath(); ! compilation.packagePath = classpath + (nestedClasspath != null ? File.pathSeparator+nestedClasspath : ""); ! compilation.output = jar; ! compilation.recompileCommandLine = recompile; ! compilation.recompileAll = recompile_all; ! compilation.skipLink = compile; ! compilation.excludeRuntime = exclude_runtime; ! compilation.runtimeFile = runtime; ! nice.tools.compiler.fun.compile ! (compilation, pack, output, native_compiler, editor); ! int retval = console.statusCode; ! switch (retval) { ! case nice.tools.compiler.console.fun.ERROR: ! throw new BuildException(ERROR_MSG, location); ! case nice.tools.compiler.console.fun.BUG: ! throw new BuildException(BUG_MSG, location); ! case nice.tools.compiler.console.fun.WARNING: ! log(WARNING_MSG, Project.MSG_WARN); ! break; ! case nice.tools.compiler.console.fun.OK: ! log(OK_MSG, Project.MSG_INFO); ! break; ! } } --- 282,326 ---- public void execute() throws BuildException { log("runtime: " + runtime, Project.MSG_VERBOSE); + log("Base dir: " + project.getBaseDir(), Project.MSG_VERBOSE); ! String oldUserDir = System.getProperty("user.dir"); ! try { ! System.setProperty("user.dir", ! project.getBaseDir().getAbsolutePath()); ! nice.tools.compiler.console.ConsoleOutput console = ! nice.tools.compiler.console.fun.consoleOutput(); ! Compilation compilation = bossa.modules.fun.createCompilation(console); ! if (sourcepath != null) ! compilation.sourcePath = sourcepath; ! if (destination != null) ! compilation.destinationDir = destination.getAbsolutePath(); ! compilation.packagePath = classpath + (nestedClasspath != null ? File.pathSeparator+nestedClasspath : ""); ! compilation.output = jar; ! compilation.recompileCommandLine = recompile; ! compilation.recompileAll = recompile_all; ! compilation.skipLink = compile; ! compilation.excludeRuntime = exclude_runtime; ! compilation.runtimeFile = runtime; ! nice.tools.compiler.fun.compile ! (compilation, pack, output, native_compiler, editor); ! int retval = console.statusCode; ! ! switch (retval) { ! case nice.tools.compiler.console.fun.ERROR: ! throw new BuildException(ERROR_MSG, location); ! case nice.tools.compiler.console.fun.BUG: ! throw new BuildException(BUG_MSG, location); ! case nice.tools.compiler.console.fun.WARNING: ! log(WARNING_MSG, Project.MSG_WARN); ! break; ! case nice.tools.compiler.console.fun.OK: ! log(OK_MSG, Project.MSG_INFO); ! break; ! } ! } ! finally { ! System.setProperty("user.dir", oldUserDir); ! } } |