Index: xotcl/ChangeLog =================================================================== diff -u -r464284f53643031115e4da0204025a733675ad60 -r2139510e0635ca88521b99d7c9751c2c15b306b6 --- xotcl/ChangeLog (.../ChangeLog) (revision 464284f53643031115e4da0204025a733675ad60) +++ xotcl/ChangeLog (.../ChangeLog) (revision 2139510e0635ca88521b99d7c9751c2c15b306b6) @@ -1,5 +1,9 @@ +2004-08-22 Gustaf.Neumann@wu-wien.ac.at + * fixed nonposargs, when used with checker procs and spaces in arguments + * auto-generating docs in build tree (instead in source tree) + 2004-08-19 Gustaf.Neumann@wu-wien.ac.at - * if configure is run autside the src tree the directory + * if configure is run outside the src tree the directory structure is now built on the fly. All binary output files are now placed in the built-tree. Index: xotcl/Makefile.in =================================================================== diff -u -r464284f53643031115e4da0204025a733675ad60 -r2139510e0635ca88521b99d7c9751c2c15b306b6 --- xotcl/Makefile.in (.../Makefile.in) (revision 464284f53643031115e4da0204025a733675ad60) +++ xotcl/Makefile.in (.../Makefile.in) (revision 2139510e0635ca88521b99d7c9751c2c15b306b6) @@ -12,7 +12,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: Makefile.in,v 1.8 2004/08/19 09:57:50 neumann Exp $ +# RCS: @(#) $Id: Makefile.in,v 1.9 2004/08/22 09:30:45 neumann Exp $ #======================================================================== # Add additional lines to handle any additional AC_SUBST cases that @@ -28,6 +28,7 @@ src_app_dir = ${srcdir}/apps src_generic_dir = ${srcdir}/generic PLATFORM_DIR = $(srcdir)/@TEA_PLATFORM@ +target_doc_dir = ./doc TCL_LIB_SPEC = @TCL_LIB_SPEC@ TK_LIB_SPEC = @TK_LIB_SPEC@ subdirs = @subdirs@ @@ -220,10 +221,10 @@ fulldoc: doc pdf # use language reference as sample file to trigger generation of documentation files -doc: $(src_doc_dir)/langRef-xotcl.html +doc: $(target_doc_dir)/langRef-xotcl.html -$(src_doc_dir)/langRef-xotcl.html: $(src_doc_dir)/langRef.xotcl $(DOC_SOURCE) - @$(TCLSH_PROG) $(src_lib_dir)/lib/makeDoc.xotcl $(src_doc_dir) $(DOC_SOURCE) +$(target_doc_dir)/langRef-xotcl.html: $(src_doc_dir)/langRef.xotcl $(DOC_SOURCE) + @$(TCLSH_PROG) $(src_lib_dir)/lib/makeDoc.xotcl $(target_doc_dir) $(DOC_SOURCE) pdf: -(cd $(src_doc_dir); htmldoc --webpage --format pdf14 --title \ @@ -459,7 +460,8 @@ #======================================================================== clean: - -rm -rf $(BINARIES) $(CLEANFILES) @XOTCLSH@ @XOWISH@ pkgIndex.tcl ./receiver $(src_doc_dir)/*-xotcl.html + -rm -rf $(BINARIES) $(CLEANFILES) @XOTCLSH@ @XOWISH@ pkgIndex.tcl ./receiver \ + $(target_doc_dir)/*-xotcl.html find ${srcdir} -type f -name \*~ -exec rm \{} \; @if test ! "x$(subdirs)" = "x" ; then dirs="$(subdirs)" ; \ for dir in $$dirs ; do \ Index: xotcl/configure =================================================================== diff -u -r464284f53643031115e4da0204025a733675ad60 -r2139510e0635ca88521b99d7c9751c2c15b306b6 --- xotcl/configure (.../configure) (revision 464284f53643031115e4da0204025a733675ad60) +++ xotcl/configure (.../configure) (revision 2139510e0635ca88521b99d7c9751c2c15b306b6) @@ -1533,13 +1533,10 @@ test_actiweb="test-actiweb" libdirs_actiweb="actiweb rdf registry store xml patterns" apps_actiweb="actiweb persistence" - mkdir -p library/store/XOTclSdbm subdirs="$subdirs library/store/XOTclSdbm/" if ! test "$with_gdbm" = no; then - mkdir -p library/store/XOTclGdbm subdirs="$subdirs library/store/XOTclGdbm/" fi - mkdir -p library/xml/TclExpat-1.1/ subdirs="$subdirs library/xml/TclExpat-1.1/" else test_actiweb="" @@ -11306,10 +11303,11 @@ for subdir in ${subdirs} do - echo "======================= configure $subdir ======================" + echo "==================== configure $subdir =====================" if test x"${srcdir}" == x. ; then confdir=. else + mkdir -p $subdir confdir=${srcdir}/$subdir fi (cd $subdir; eval $SHELL ${confdir}/configure ${ac_configure_args} --with-xotcl=${here}) Index: xotcl/configure.in =================================================================== diff -u -r464284f53643031115e4da0204025a733675ad60 -r2139510e0635ca88521b99d7c9751c2c15b306b6 --- xotcl/configure.in (.../configure.in) (revision 464284f53643031115e4da0204025a733675ad60) +++ xotcl/configure.in (.../configure.in) (revision 2139510e0635ca88521b99d7c9751c2c15b306b6) @@ -72,15 +72,12 @@ test_actiweb="test-actiweb" libdirs_actiweb="actiweb rdf registry store xml patterns" apps_actiweb="actiweb persistence" - mkdir -p library/store/XOTclSdbm subdirs="$subdirs library/store/XOTclSdbm/" dnl AC_CONFIG_SUBDIRS(library/store/XOTclSdbm/) if ! test "$with_gdbm" = no; then - mkdir -p library/store/XOTclGdbm subdirs="$subdirs library/store/XOTclGdbm/" dnl AC_CONFIG_SUBDIRS(library/store/XOTclGdbm/) fi - mkdir -p library/xml/TclExpat-1.1/ subdirs="$subdirs library/xml/TclExpat-1.1/" dnl AC_CONFIG_SUBDIRS(library/xml/TclExpat-1.1/) else @@ -434,10 +431,11 @@ for subdir in ${subdirs} do - echo "======================= configure $subdir ======================" + echo "==================== configure $subdir =====================" if test x"${srcdir}" == x. ; then confdir=. else + mkdir -p $subdir confdir=${srcdir}/$subdir fi (cd $subdir; eval $SHELL ${confdir}/configure ${ac_configure_args} --with-xotcl=${here}) Index: xotcl/generic/xotcl.c =================================================================== diff -u -r638782f84b31e4ebfd00529381e280c70f9950bc -r2139510e0635ca88521b99d7c9751c2c15b306b6 --- xotcl/generic/xotcl.c (.../xotcl.c) (revision 638782f84b31e4ebfd00529381e280c70f9950bc) +++ xotcl/generic/xotcl.c (.../xotcl.c) (revision 2139510e0635ca88521b99d7c9751c2c15b306b6) @@ -1,4 +1,4 @@ -/* $Id: xotcl.c,v 1.22 2004/08/17 10:12:55 neumann Exp $ +/* $Id: xotcl.c,v 1.23 2004/08/22 09:30:45 neumann Exp $ * * XOTcl - Extended OTcl * @@ -4407,27 +4407,31 @@ DECR_REF_COUNT(npaObj); DECR_REF_COUNT(nonPosArgsObj); return XOTclVarErrMsg(in, "non-positional args does not start with '-': ", - arg, " in: ", - ObjStr(objv[2]), (char *)NULL); + arg, " in: ", ObjStr(objv[2]), (char *)NULL); } length = strlen(arg); for (j=0; j0 && isspace(arg[end-1]); end--); + Tcl_ListObjAppendElement(in, list, Tcl_NewStringObj(arg+start, end-start)); l++; start = l; + while(start0 && isspace(arg[end-1]); end--); + Tcl_ListObjAppendElement(in, list, Tcl_NewStringObj(arg+start, end-start)); /* append the whole thing to the list */ Tcl_ListObjAppendElement(in, npaObj, list); } else { @@ -9815,8 +9819,7 @@ } else if ((selfObj = GetSelfObj(in))) { nonPosArgsTable = selfObj->nonPosArgsTable; } else { - return XOTclVarErrMsg(in, - "Non positional args: can't find self/self class", + return XOTclVarErrMsg(in, "Non positional args: can't find self/self class", NULL); } @@ -9841,8 +9844,7 @@ } for (i=0; i < nonPosArgsDefc; i++) { - r1 = Tcl_ListObjGetElements(in, nonPosArgsDefv[i], - &npac, &npav); + r1 = Tcl_ListObjGetElements(in, nonPosArgsDefv[i], &npac, &npav); if (r1 == TCL_OK && npac == 3) { Tcl_ObjSetVar2(in, npav[0], 0, npav[2], 0); } @@ -9902,8 +9904,7 @@ } for (i=0; i < nonPosArgsDefc; i++) { - r1 = Tcl_ListObjGetElements(in, nonPosArgsDefv[i], - &npac, &npav); + r1 = Tcl_ListObjGetElements(in, nonPosArgsDefv[i], &npac, &npav); if (r1 == TCL_OK && npac > 1 && *(ObjStr(npav[1])) != '\0') { r1 = Tcl_ListObjGetElements(in, npav[1], &checkc, &checkv); if (r1 == TCL_OK) { @@ -9925,8 +9926,12 @@ invocation[3] = Tcl_ObjGetVar2(in, npav[0], 0, 0); ic = 4; } + result = Tcl_EvalObjv(in, ic, invocation, 0); + /* objPtr = Tcl_ConcatObj(ic, invocation); + fprintf(stderr,"eval on <%s>\n",ObjStr(objPtr)); result = Tcl_EvalObjEx(in, objPtr, TCL_EVAL_DIRECT); + */ if (result != TCL_OK) { return result; } Index: xotcl/library/lib/makeDoc.xotcl =================================================================== diff -u -rf7894d9be99a8da3a04218abcdb9bd46b6d625c8 -r2139510e0635ca88521b99d7c9751c2c15b306b6 --- xotcl/library/lib/makeDoc.xotcl (.../makeDoc.xotcl) (revision f7894d9be99a8da3a04218abcdb9bd46b6d625c8) +++ xotcl/library/lib/makeDoc.xotcl (.../makeDoc.xotcl) (revision 2139510e0635ca88521b99d7c9751c2c15b306b6) @@ -1,4 +1,4 @@ -#$Id: makeDoc.xotcl,v 1.1 2004/05/23 22:50:39 neumann Exp $ +#$Id: makeDoc.xotcl,v 1.2 2004/08/22 09:30:46 neumann Exp $ package require XOTcl namespace import ::xotcl::* @ @File { @@ -20,6 +20,9 @@ if {$argc > 1} { set DOCDIR [lindex $argv 0] puts "Documenting to directory $DOCDIR:" + if {![file isdirectory $DOCDIR]} { + file mkdir $DOCDIR + } if {$::tcl_platform(platform) == "windows"} { set files "" foreach f [lrange $argv 1 end] { Index: xotcl/tests/testx.xotcl =================================================================== diff -u -r638782f84b31e4ebfd00529381e280c70f9950bc -r2139510e0635ca88521b99d7c9751c2c15b306b6 --- xotcl/tests/testx.xotcl (.../testx.xotcl) (revision 638782f84b31e4ebfd00529381e280c70f9950bc) +++ xotcl/tests/testx.xotcl (.../testx.xotcl) (revision 2139510e0635ca88521b99d7c9751c2c15b306b6) @@ -1,4 +1,4 @@ -#$Id: testx.xotcl,v 1.15 2004/08/17 10:12:55 neumann Exp $ +#$Id: testx.xotcl,v 1.16 2004/08/22 09:30:46 neumann Exp $ package require XOTcl namespace import -force xotcl::* @@ -3391,17 +3391,20 @@ return "$b $arg" } Object colorchecker - colorchecker proc color {a b c argName args} { - lappend ::r "$a $b $c" + colorchecker proc color {var value} { + lappend ::r "color <$var> <$value>" } - colorchecker proc reddish {argName args} { - lappend ::r "reddish" + colorchecker proc reddish {var value} { + lappend ::r "reddish <$var> <$value>" } - o proc z4 {{{-b:checkobj colorchecker , color must be red, reddish, checkobj xotcl::nonPosArgs , required} red} {{-c: required}}} {arg} { + o proc z4 {{{-b: required, checkobj colorchecker,color, reddish, + checkobj xotcl::nonPosArgs,required} red} + {{-c: required }}} {arg} { lappend ::r "$b $arg" return "$b $arg" } + Class P P instproc x {a b} { return "$a $b" @@ -3452,13 +3455,13 @@ set ::r "" o z4 -c 1 1 - errorCheck $::r [list {must be red} reddish {red 1}] \ + errorCheck $::r "{color } {reddish } {red 1}" \ "multiple check options + checkobject" errorCheck [o info body z2] {return "$x -- $args -- $a -- $b"} "info body 1" errorCheck [P info instbody z2] {return "$x -- $args -- $a -- $b"} "info instbody z2" errorCheck [o info args z4] {arg} "info args" - errorCheck [o info nonposargs z4] {{{-b:checkobj colorchecker , color must be red, reddish, checkobj xotcl::nonPosArgs , required} red} {{-c: required}}} "info nonposargs 1" + errorCheck [o info nonposargs z4] "{{-b:required,checkobj colorchecker,color,reddish,checkobj xotcl::nonPosArgs,required} red} -c:required" "info nonposargs 1" errorCheck [o info nonposargs x] {} "info nonposargs 2" errorCheck [P info instargs z3] {a b c} "info instargs" errorCheck [P info instnonposargs z3] {-x:required {-a 1} {-b {1 2}}} "info instnonposargs 1"