Index: generic/nsf.c =================================================================== diff -u -N -rdadc7c6c6858ff3b816ff4cc585e0d76684ec374 -r35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30 --- generic/nsf.c (.../nsf.c) (revision dadc7c6c6858ff3b816ff4cc585e0d76684ec374) +++ generic/nsf.c (.../nsf.c) (revision 35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30) @@ -9248,13 +9248,28 @@ static void NsfParamDefsSyntaxOne(Tcl_Obj *argStringObj, Nsf_Param CONST *pPtr) { - Tcl_AppendLimitedToObj(argStringObj, pPtr->name, -1, INT_MAX, NULL); if (pPtr->nrArgs > 0 && *pPtr->name == '-') { + Tcl_AppendLimitedToObj(argStringObj, pPtr->name, -1, INT_MAX, NULL); Tcl_AppendLimitedToObj(argStringObj, " ", 1, INT_MAX, NULL); - Tcl_AppendLimitedToObj(argStringObj, ParamGetDomain(pPtr), -1, INT_MAX, NULL); - if (pPtr->flags & NSF_ARG_MULTIVALUED) { - Tcl_AppendLimitedToObj(argStringObj, " ...", 4, INT_MAX, NULL); + if ((pPtr->flags & NSF_ARG_IS_ENUMERATION)) { + Tcl_AppendLimitedToObj(argStringObj, ParamGetDomain(pPtr), -1, INT_MAX, NULL); + if (pPtr->flags & NSF_ARG_MULTIVALUED) { + Tcl_AppendLimitedToObj(argStringObj, " ...", 4, INT_MAX, NULL); + } + } else { + Tcl_AppendLimitedToObj(argStringObj, "/", 1, INT_MAX, NULL); + Tcl_AppendLimitedToObj(argStringObj, ParamGetDomain(pPtr), -1, INT_MAX, NULL); + if (pPtr->flags & NSF_ARG_MULTIVALUED) { + Tcl_AppendLimitedToObj(argStringObj, " ...", 4, INT_MAX, NULL); + } + Tcl_AppendLimitedToObj(argStringObj, "/", 1, INT_MAX, NULL); } + } else if (*pPtr->name != '-') { + Tcl_AppendLimitedToObj(argStringObj, "/", 1, INT_MAX, NULL); + Tcl_AppendLimitedToObj(argStringObj, pPtr->name, -1, INT_MAX, NULL); + Tcl_AppendLimitedToObj(argStringObj, "/", 1, INT_MAX, NULL); + } else { + Tcl_AppendLimitedToObj(argStringObj, pPtr->name, -1, INT_MAX, NULL); } } @@ -9301,14 +9316,12 @@ } if (pPtr->converter == ConvertToNothing && strcmp(pPtr->name, "args") == 0) { - Tcl_AppendLimitedToObj(argStringObj, "?arg ...?", 9, INT_MAX, NULL); + Tcl_AppendLimitedToObj(argStringObj, "?/arg .../?", 11, INT_MAX, NULL); } else if (pPtr->flags & NSF_ARG_REQUIRED) { if ((pPtr->flags & NSF_ARG_IS_ENUMERATION)) { Tcl_AppendLimitedToObj(argStringObj, ParamGetDomain(pPtr), -1, INT_MAX, NULL); } else { - Tcl_AppendLimitedToObj(argStringObj, "/", 1, INT_MAX, NULL); NsfParamDefsSyntaxOne(argStringObj, pPtr); - Tcl_AppendLimitedToObj(argStringObj, "/", 1, INT_MAX, NULL); } } else { Tcl_AppendLimitedToObj(argStringObj, "?", 1, INT_MAX, NULL); @@ -17582,7 +17595,7 @@ ListCmdParams(Tcl_Interp *interp, Tcl_Command cmd, CONST char *methodName, NsfParamsPrintStyle printStyle) { NsfParamDefs *paramDefs; - Tcl_Obj *list; + Tcl_Obj *listObj; Proc *procPtr; assert(methodName); @@ -17594,9 +17607,9 @@ /* * Obtain parameter info from paramDefs. */ - list = ListParamDefs(interp, paramDefs->paramsPtr, printStyle); - Tcl_SetObjResult(interp, list); - DECR_REF_COUNT2("paramDefsObj", list); + listObj = ListParamDefs(interp, paramDefs->paramsPtr, printStyle); + Tcl_SetObjResult(interp, listObj); + DECR_REF_COUNT2("paramDefsObj", listObj); return TCL_OK; } @@ -17607,7 +17620,7 @@ */ CompiledLocal *args = procPtr->firstLocalPtr; - list = Tcl_NewListObj(0, NULL); + listObj = Tcl_NewListObj(0, NULL); for ( ; args; args = args->nextPtr) { if (!TclIsCompiledLocalArgument(args)) { @@ -17616,30 +17629,39 @@ if (printStyle == NSF_PARAMS_SYNTAX && strcmp(args->name, "args") == 0) { if (args != procPtr->firstLocalPtr) { - Tcl_AppendToObj(list, " ", 1); + Tcl_AppendToObj(listObj, " ", 1); } - Tcl_AppendToObj(list, "?arg ...?", 9); + Tcl_AppendToObj(listObj, "?/arg .../?", 11); } else { if (printStyle == NSF_PARAMS_SYNTAX) { - /* a default means that the arg is optional xxxxxx */ + /* + * A default means that the argument is optional. + */ if (args->defValuePtr) { - Tcl_AppendToObj(list, "?", 1); - Tcl_AppendToObj(list, args->name, -1); - Tcl_AppendToObj(list, " ", 1); - Tcl_ListObjAppendElement(interp, list, args->defValuePtr); - Tcl_AppendToObj(list, "?", 1); + Tcl_AppendToObj(listObj, "?", 1); + Tcl_AppendToObj(listObj, args->name, -1); + Tcl_AppendToObj(listObj, "?", 1); } else { - Tcl_AppendToObj(list, "/", 1); - Tcl_AppendToObj(list, args->name, -1); - Tcl_AppendToObj(list, "/", 1); + Tcl_AppendToObj(listObj, "/", 1); + Tcl_AppendToObj(listObj, args->name, -1); + Tcl_AppendToObj(listObj, "/", 1); } } else { - Tcl_ListObjAppendElement(interp, list, Tcl_NewStringObj(args->name, -1)); + Tcl_Obj *innerListObj = Tcl_NewListObj(0, NULL); + + Tcl_ListObjAppendElement(interp, innerListObj, Tcl_NewStringObj(args->name, -1)); + /* + * Return default just for NSF_PARAMS_PARAMETER. + */ + if (args->defValuePtr && printStyle == NSF_PARAMS_PARAMETER) { + Tcl_ListObjAppendElement(interp, innerListObj, args->defValuePtr); + } + Tcl_ListObjAppendElement(interp, listObj, innerListObj); } } } - Tcl_SetObjResult(interp, list); + Tcl_SetObjResult(interp, listObj); return TCL_OK; } Index: generic/nsf.tcl =================================================================== diff -u -N -r7495af656ca04a32826ecb0b6e207f886eaaa7f8 -r35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30 --- generic/nsf.tcl (.../nsf.tcl) (revision 7495af656ca04a32826ecb0b6e207f886eaaa7f8) +++ generic/nsf.tcl (.../nsf.tcl) (revision 35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30) @@ -191,8 +191,8 @@ # if HOME is not set, and ~ is resolved, Tcl chokes on that if {![info exists ::env(HOME)]} {set ::env(HOME) /root} - set ::nsf::parametersyntax(::nsf::xotclnext) "?--noArgs? ?arg ...?" + set ::nsf::parametersyntax(::nsf::xotclnext) "?--noArgs? ?/arg .../?" set ::nsf::parametersyntax(::nsf::__unset_unknown_args) "" - set ::nsf::parametersyntax(::nsf::exithandler) "?get?|?set cmds?|?unset?" + set ::nsf::parametersyntax(::nsf::exithandler) "?get?|?set /cmds/?|?unset?" } Index: generic/predefined.h =================================================================== diff -u -N -r8c8969ab850d118f76305689bd95e980b8f4543f -r35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30 --- generic/predefined.h (.../predefined.h) (revision 8c8969ab850d118f76305689bd95e980b8f4543f) +++ generic/predefined.h (.../predefined.h) (revision 35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30) @@ -78,8 +78,8 @@ "return /tmp}\n" "namespace export tmpdir\n" "if {![info exists ::env(HOME)]} {set ::env(HOME) /root}\n" -"set ::nsf::parametersyntax(::nsf::xotclnext) \"?--noArgs? ?arg ...?\"\n" +"set ::nsf::parametersyntax(::nsf::xotclnext) \"?--noArgs? ?/arg .../?\"\n" "set ::nsf::parametersyntax(::nsf::__unset_unknown_args) \"\"\n" -"set ::nsf::parametersyntax(::nsf::exithandler) \"?get?|?set cmds?|?unset?\"}\n" +"set ::nsf::parametersyntax(::nsf::exithandler) \"?get?|?set /cmds/?|?unset?\"}\n" ""; Index: library/nx/nx.tcl =================================================================== diff -u -N -r5cb647f407e85768c452ee22eaf881d628511c87 -r35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30 --- library/nx/nx.tcl (.../nx.tcl) (revision 5cb647f407e85768c452ee22eaf881d628511c87) +++ library/nx/nx.tcl (.../nx.tcl) (revision 35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30) @@ -2451,15 +2451,15 @@ #interp alias {} ::nx::self {} ::nsf::self - set value "?classes?|?add class?|?delete class?" + set value "?/class .../?|?add /class/?|?delete /class/?" set "::nsf::parametersyntax(::nsf::classes::nx::Object::object mixin)" $value set "::nsf::parametersyntax(::nsf::classes::nx::Class::mixin)" $value set "::nsf::parametersyntax(::nsf::classes::nx::Class::superclass)" $value - set "::nsf::parametersyntax(::nsf::classes::nx::Object::class)" "?className?" - set value "?filters?|?add filter?|?delete filter?" + set "::nsf::parametersyntax(::nsf::classes::nx::Object::class)" "?/className/?" + set value "?/filters/?|?add /filter/?|?delete /filter/?" set "::nsf::parametersyntax(::nsf::classes::nx::Object::object filter)" $value set "::nsf::parametersyntax(::nsf::classes::nx::Class::filter)" $value - set "::nsf::parametersyntax(::nsf::classes::nx::Object::eval)" "arg ?arg ...?" + set "::nsf::parametersyntax(::nsf::classes::nx::Object::eval)" "/arg/ ?/arg/ ...?" unset value ::nsf::configure debug 1 Index: library/xotcl/tests/testx.xotcl =================================================================== diff -u -N -r5d1617640ad71fd52b069f81cfcadbe4cbb6f2a2 -r35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30 --- library/xotcl/tests/testx.xotcl (.../testx.xotcl) (revision 5d1617640ad71fd52b069f81cfcadbe4cbb6f2a2) +++ library/xotcl/tests/testx.xotcl (.../testx.xotcl) (revision 35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30) @@ -4029,26 +4029,26 @@ o y 4 56 5 } m errorCheck $m \ - {invalid argument '5', maybe too many arguments; should be "::o y ?-x value? ?-a value? a b"} \ + {invalid argument '5', maybe too many arguments; should be "::o y ?-x /value/? ?-a /value/? /a/ /b/"} \ "wrong \# check 1" catch { o y } m errorCheck $m {required argument 'a' is missing, should be: - ::o y ?-x value? ?-a value? a b} "wrong \# check 2" + ::o y ?-x /value/? ?-a /value/? /a/ /b/} "wrong \# check 2" catch { o y -x 1 } m errorCheck $m {required argument 'a' is missing, should be: - ::o y ?-x value? ?-a value? a b} "wrong \# check 3" + ::o y ?-x /value/? ?-a /value/? /a/ /b/} "wrong \# check 3" catch { o z1 a 1 2 3 } m errorCheck $m {required argument 'x' is missing, should be: - ::o z1 -x value ?-a value? a ?arg ...?} "required missing" + ::o z1 -x /value/ ?-a /value/? /a/ ?/arg .../?} "required missing" errorCheck [o z1 -x 1 a 1 2 3] "1 -- 1 2 3" "invocation 1" errorCheck [o z2 -x 2 a 1 2 3] "2 -- a 1 2 3 -- 1 -- 1 2" "invocation 2" catch { @@ -4128,7 +4128,7 @@ catch {oa foo "--"} msg errorCheck $msg {required argument 'b' is missing, should be: - ::oa foo ?-a value? b} "Non-pos arg: double dash alone" + ::oa foo ?-a /value/? /b/} "Non-pos arg: double dash alone" Class C C create c1 Index: tests/cget.test =================================================================== diff -u -N -rdadc7c6c6858ff3b816ff4cc585e0d76684ec374 -r35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30 --- tests/cget.test (.../cget.test) (revision dadc7c6c6858ff3b816ff4cc585e0d76684ec374) +++ tests/cget.test (.../cget.test) (revision 35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30) @@ -55,7 +55,7 @@ # # configure without arguments # - ? {p1 configure} "?-sex value? -famnam value ?-age integer? ?-friends value ...? ?-volatile? ?-noinit? ?-object-mixin mixinreg ...? ?-class class? ?-object-filter filterreg ...? ?__initcmd?" + ? {p1 configure} "?-sex /value/? -famnam /value/ ?-age /integer/? ?-friends /value .../? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initcmd/?" } # @@ -95,7 +95,7 @@ # # configure without arguments # - ? {p1 configure} "?-bar1 value? ?-bar2 value? ?-volatile? ?-noinit? ?-object-mixin mixinreg ...? ?-class class? ?-object-filter filterreg ...? ?__initcmd?" + ? {p1 configure} "?-bar1 /value/? ?-bar2 /value/? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initcmd/?" # # test gettin/setting via slots Index: tests/contains.test =================================================================== diff -u -N -rf858f142f5fab4f88996b3eb709c3afa55114be9 -r35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30 --- tests/contains.test (.../contains.test) (revision f858f142f5fab4f88996b3eb709c3afa55114be9) +++ tests/contains.test (.../contains.test) (revision 35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30) @@ -90,7 +90,7 @@ C public method foo {{-new 0} name value} { return $value} catch {c1 foo -name a b} errMsg ? {set errMsg} \ - {invalid argument 'b', maybe too many arguments; should be "::c1 foo ?-new value? name value"} + {invalid argument 'b', maybe too many arguments; should be "::c1 foo ?-new /value/? /name/ /value/"} # Test resolving of implicit namespaces in relationcmds (here # superclass) in the nx namespace. Index: tests/disposition.test =================================================================== diff -u -N -rf858f142f5fab4f88996b3eb709c3afa55114be9 -r35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30 --- tests/disposition.test (.../disposition.test) (revision f858f142f5fab4f88996b3eb709c3afa55114be9) +++ tests/disposition.test (.../disposition.test) (revision 35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30) @@ -195,7 +195,7 @@ "value for parameter '-x' expected" ? {[C new -single-np [list -x X]] eval {set :single-np}} \ "invalid non-positional argument '-x X', valid are : -x; - should be \"::__%&singleton single-np -x value\"" + should be \"::__%&singleton single-np -x /value/\"" # # INTERACTIONS with other parameter types @@ -1262,7 +1262,7 @@ # ISSUE: positional objparam + alias + noarg -> what's the point? # noarg & ?z? are irritating, ?z? should not be printed! # - ? {T create t XXX} "invalid argument 'XXX', maybe too many arguments; should be \"::t configure ?z?\"" + ? {T create t XXX} "invalid argument 'XXX', maybe too many arguments; should be \"::t configure ?/z/?\"" ::obj object mixin {} T setObjectParams [list z:alias] Index: tests/info-method.test =================================================================== diff -u -N -r5cb647f407e85768c452ee22eaf881d628511c87 -r35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30 --- tests/info-method.test (.../info-method.test) (revision 5cb647f407e85768c452ee22eaf881d628511c87) +++ tests/info-method.test (.../info-method.test) (revision 35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30) @@ -662,7 +662,7 @@ ? {nx::Object info method parameter "info lookup methods"} \ "-callprotection -incontext:switch -methodtype -nomixins:switch -path:switch -source pattern:optional" ? {nx::Object info method syntax "info lookup methods"} \ - "?-callprotection all|public|protected|private? ?-incontext? ?-methodtype all|scripted|builtin|alias|forwarder|object|setter|nsfproc? ?-nomixins? ?-path? ?-source all|application|baseclasses? ?pattern?" + "?-callprotection all|public|protected|private? ?-incontext? ?-methodtype all|scripted|builtin|alias|forwarder|object|setter|nsfproc? ?-nomixins? ?-path? ?-source all|application|baseclasses? ?/pattern/?" ? {o info object method parameter "foo b"} "x:int y:upper" @@ -698,8 +698,8 @@ } C new - ? {C info parameter syntax} "?-a value? ?-b value? ?-volatile? ?-noinit? ?-object-mixin mixinreg ...? ?-class class? ?-object-filter filterreg ...? ?__initcmd?" - ? {C info parameter syntax a} "?-a value?" + ? {C info parameter syntax} "?-a /value/? ?-b /value/? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initcmd/?" + ? {C info parameter syntax a} "?-a /value/?" ? {C info parameter definitions} "-a {-b 1} -volatile:alias,slot=::nx::Object::slot::volatile,slotassign,noarg -noinit:alias,method=::nsf::methods::object::noinit,noarg -object-mixin:mixinreg,alias,method=::nx::Object::slot::__object::mixin,1..n -class:class,alias,method=::nsf::methods::object::class -object-filter:filterreg,alias,method=::nx::Object::slot::__object::filter,1..n __initcmd:initcmd,optional,noleadingdash" @@ -780,12 +780,12 @@ # nx::Test case parametersyntax { # a true method - ? {::nx::Class info method syntax method} "name arguments ?-returns value? body ?-precondition value? ?-postcondition value?" + ? {::nx::Class info method syntax method} "/name/ /arguments/ ?-returns /value/? /body/ ?-precondition /value/? ?-postcondition /value/?" # a forwarder to ::nsf::relation; definition comes via array ::nsf::parametersyntax - ? {::nx::Class info method syntax mixin} "?classes?|?add class?|?delete class?" + ? {::nx::Class info method syntax mixin} "?/class .../?|?add /class/?|?delete /class/?" - ? {::nx::Class info method syntax ::nx::next} "?arguments?" - ? {::nx::Class info method syntax ::nsf::xotclnext} "?--noArgs? ?arg ...?" + ? {::nx::Class info method syntax ::nx::next} "?/arguments/?" + ? {::nx::Class info method syntax ::nsf::xotclnext} "?--noArgs? ?/arg .../?" } # @@ -1203,5 +1203,5 @@ # Test error messages within an ensemble call # nx::Test case error-in-ensemble { - ? {nx::Object info method definition foo 1} {invalid argument '1', maybe too many arguments; should be "::nx::Object info method args|body|definition|exists|registrationhandle|definitionhandle|handle|origin|parameter|syntax|type|precondition|postcondition|submethods|returns name"} + ? {nx::Object info method definition foo 1} {invalid argument '1', maybe too many arguments; should be "::nx::Object info method args|body|definition|exists|registrationhandle|definitionhandle|handle|origin|parameter|syntax|type|precondition|postcondition|submethods|returns /name/"} } \ No newline at end of file Index: tests/method-parameter.test =================================================================== diff -u -N -rdadc7c6c6858ff3b816ff4cc585e0d76684ec374 -r35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30 --- tests/method-parameter.test (.../method-parameter.test) (revision dadc7c6c6858ff3b816ff4cc585e0d76684ec374) +++ tests/method-parameter.test (.../method-parameter.test) (revision 35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30) @@ -13,17 +13,17 @@ ? {p1} 0 ? {p1 -x} {value for parameter '-x' expected} ? {p1 -x 1} 1 - ? {p1 -x 1 2} {invalid argument '2', maybe too many arguments; should be "p1 ?-x value?"} + ? {p1 -x 1 2} {invalid argument '2', maybe too many arguments; should be "p1 ?-x /value/?"} ? {p1 -x 1 -y} {invalid non-positional argument '-y', valid are : -x; - should be "p1 ?-x value?"} - ? {p1 a} {invalid argument 'a', maybe too many arguments; should be "p1 ?-x value?"} - ? {p1 a -x} {invalid argument 'a', maybe too many arguments; should be "p1 ?-x value?"} + should be "p1 ?-x /value/?"} + ? {p1 a} {invalid argument 'a', maybe too many arguments; should be "p1 ?-x /value/?"} + ? {p1 a -x} {invalid argument 'a', maybe too many arguments; should be "p1 ?-x /value/?"} ? {p1 --} 0 ? {p1 -y} {invalid non-positional argument '-y', valid are : -x; - should be "p1 ?-x value?"} + should be "p1 ?-x /value/?"} ? {p1 -y --} {invalid non-positional argument '-y', valid are : -x; - should be "p1 ?-x value?"} + should be "p1 ?-x /value/?"} # # should we really allow numeric nonpos arg names? @@ -50,15 +50,15 @@ ? {p2a -x 1 -y} {1 -y} ? {p2b -x 1 -y} {invalid non-positional argument '-y', valid are : -x; - should be "p2b ?-x value? ?arg ...?"} + should be "p2b ?-x /value/? ?/arg .../?"} ? {p2c -x 1 -y} {invalid non-positional argument '-y', valid are : -x; - should be "p2c ?-x value? ?arg ...?"} + should be "p2c ?-x /value/? ?/arg .../?"} nsf::proc p3a {a -x -y b:noleadingdash -z} {return [list $a [info exists x] [info exists y] $b]} ? {p3a 100 -x 1 -y 1 200} {100 1 1 200} ? {p3a 100 -xx 1 -y 1 200} {invalid non-positional argument '-xx', valid are : -x, -y; - should be "p3a /a/ ?-x value? ?-y value? /b/ ?-z value?"} + should be "p3a /a/ ?-x /value/? ?-y /value/? /b/ ?-z /value/?"} } nx::Test case unknown-handler { @@ -68,15 +68,15 @@ :create c1 } ? {c1 p1 -x 1 -y} {invalid non-positional argument '-y', valid are : -x; - should be "::c1 p1 ?-x value?"} + should be "::c1 p1 ?-x /value/?"} proc ::nsf::argument::unknown {method arg args} { puts stderr "??? unknown nonpos-arg $arg in $method obj <$args>\n[info frame -1]\n" return "" } ? {c1 p1 -x 1 -y} {invalid non-positional argument '-y', valid are : -x; - should be "::c1 p1 ?-x value?"} + should be "::c1 p1 ?-x /value/?"} if {0} { proc ::nsf::argument::unknown {method arg args} { @@ -87,6 +87,6 @@ } ? {c1 p1 -x 1 -y} {invalid non-positional argument '-y', valid are : -x; - should be "::c1 p1 ?-x value?"} + should be "::c1 p1 ?-x /value/?"} } } Index: tests/parameters.test =================================================================== diff -u -N -r5cb647f407e85768c452ee22eaf881d628511c87 -r35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30 --- tests/parameters.test (.../parameters.test) (revision 5cb647f407e85768c452ee22eaf881d628511c87) +++ tests/parameters.test (.../parameters.test) (revision 35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30) @@ -20,14 +20,14 @@ ? {::nsf::method::alias C} \ {required argument 'methodName' is missing, should be: - ::nsf::method::alias object ?-per-object? methodName ?-frame method|object|default? cmdName} + ::nsf::method::alias /object/ ?-per-object? /methodName/ ?-frame method|object|default? /cmdName/} ? {::nsf::method::alias C foo ::set} "::nsf::classes::C::foo" ? {::nsf::method::alias C foo ::set 1} \ - {invalid argument '1', maybe too many arguments; should be "::nsf::method::alias object ?-per-object? methodName ?-frame method|object|default? cmdName"} + {invalid argument '1', maybe too many arguments; should be "::nsf::method::alias /object/ ?-per-object? /methodName/ ?-frame method|object|default? /cmdName/"} - ? {C eval {:property x -class D}} {invalid argument 'D', maybe too many arguments; should be "::C property ?-accessor value? ?-config boolean? ?-incremental? ?-class value? spec ?initblock?"} "Test whether the colon prefix is suppressed" + ? {C eval {:property x -class D}} {invalid argument 'D', maybe too many arguments; should be "::C property ?-accessor /value/? ?-config /boolean/? ?-incremental? ?-class /value/? /spec/ ?/initblock/?"} "Test whether the colon prefix is suppressed" } ####################################################### @@ -380,7 +380,7 @@ ? {D create d1} \ {required argument 'd' is missing, should be: - ::d1 __configure -d value ?-a value? ?-b boolean? ?-c value? ?-volatile? ?-noinit? ?-object-mixin mixinreg ...? ?-class class? ?-object-filter filterreg ...? ?__initcmd?} + ::d1 __configure -d /value/ ?-a /value/? ?-b /boolean/? ?-c /value/? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initcmd/?} ? {D create d2 -d x -b a} \ {expected boolean but got "a" for parameter "-b"} \ @@ -393,7 +393,7 @@ ? {d1 foo} \ {required argument 'r' is missing, should be: - ::d1 foo ?-b boolean? -r integer ?-x integer? ?-object object? ?-class class?} \ + ::d1 foo ?-b /boolean/? -r /integer/ ?-x /integer/? ?-object /object/? ?-class /class/?} \ "call method without a required argument" ? {d1 foo -r a} \ @@ -1589,17 +1589,17 @@ } ? {Foo info method syntax noarg} "" - ? {Foo info method syntax onearg} "?-x value?" - ? {Foo info method syntax intarg} "?-x integer?" - ? {Foo info method syntax intsarg} "?-x integer ...?" - ? {Foo info method syntax boolarg} "?-x boolean?" - ? {Foo info method syntax classarg} "?-x class?" - ? {Foo info method syntax upperarg} "?-x upper?" - ? {Foo info method syntax metaclassarg} "?-x metaclass?" + ? {Foo info method syntax onearg} "?-x /value/?" + ? {Foo info method syntax intarg} "?-x /integer/?" + ? {Foo info method syntax intsarg} "?-x /integer .../?" + ? {Foo info method syntax boolarg} "?-x /boolean/?" + ? {Foo info method syntax classarg} "?-x /class/?" + ? {Foo info method syntax upperarg} "?-x /upper/?" + ? {Foo info method syntax metaclassarg} "?-x /metaclass/?" # return enumeration type ? {nx::Class info method syntax "info mixinof"} \ - "?-closure? ?-scope all|class|object? ?pattern?" + "?-closure? ?-scope all|class|object? ?/pattern/?" } # @@ -1897,8 +1897,8 @@ c1 object mixin add ::M2 ? {c1 info object mixin classes} {::M2 ::M1} ? {c1 cget -object-mixin} {::M2 ::M1} - ? {c1 info lookup parameter syntax b1} "-b1 value" - ? {c1 info lookup parameter syntax b2} "-b2 value" + ? {c1 info lookup parameter syntax b1} "-b1 /value/" + ? {c1 info lookup parameter syntax b2} "-b2 /value/" ? {lsort [c1 info lookup parameter names b*]} "b1 b2" # @@ -1913,7 +1913,7 @@ # c1 object mixin add ::M1 ? {c1 info object mixin classes} {::M1} - ? {c1 info lookup parameter syntax b1} "-b1 value" + ? {c1 info lookup parameter syntax b1} "-b1 /value/" ? {lsort [c1 info lookup parameter names b*]} "b1" # # We have the per-object cache; adding a per-object property should @@ -2259,7 +2259,7 @@ # ? {C info parameter list a} "-a" ? {C info parameter definitions a} "{-a a0}" - ? {C info parameter syntax a} "?-a value?" + ? {C info parameter syntax a} "?-a /value/?" ? {C info parameter definitions v} "" ? {C info slot definitions v} "{::C variable v v0}" @@ -2269,7 +2269,7 @@ ? {C create c2 -a 10} ::c2 ? {C create c2 -v 10} \ {invalid non-positional argument '-v', valid are : -a, -volatile, -noinit, -object-mixin, -class, -object-filter; - should be "::c2 configure ?-a value? ?-volatile? ?-noinit? ?-object-mixin mixinreg ...? ?-class class? ?-object-filter filterreg ...? ?__initcmd?"} + should be "::c2 configure ?-a /value/? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initcmd/?"} # # We expect a setter for "a" but not for "v". Index: tests/properties.test =================================================================== diff -u -N -rb531a50ecc43d0c13e2432b099a436c3260c7a49 -r35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30 --- tests/properties.test (.../properties.test) (revision b531a50ecc43d0c13e2432b099a436c3260c7a49) +++ tests/properties.test (.../properties.test) (revision 35c0d6ecb3c83cc6d6b0dfe251ba1a0d9071dc30) @@ -40,7 +40,7 @@ # # just the public properties are accessible via the configure interface # - ? {c1 configure} { ?-e value? ?-a value? ?-b value? ?-volatile? ?-noinit? ?-object-mixin mixinreg ...? ?-class class? ?-object-filter filterreg ...? ?__initcmd?} + ? {c1 configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initcmd/?} ? {lsort [C info slot definitions]} {{::C property -accessor none {a a1}} {::C property -accessor none {e e1}} {::C property {b b1}} {::C variable -accessor private d d1} {::C variable -accessor private vd vd1} {::C variable -accessor protected c c1} {::C variable -accessor protected vc vc1} {::C variable -accessor public vb vb1} {::C variable va va1} {::C variable ve ve1} {::C variable vf vf1}} @@ -215,7 +215,7 @@ # # The use of "-incremental" implies multivalued # - ? {c1 configure} { ?-e value ...? ?-a value ...? ?-b value ...? ?-volatile? ?-noinit? ?-object-mixin mixinreg ...? ?-class class? ?-object-filter filterreg ...? ?__initcmd?} + ? {c1 configure} { ?-e /value .../? ?-a /value .../? ?-b /value .../? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initcmd/?} ? {c1 cget -a} a1 ? {c1 cget -b} b1 @@ -390,7 +390,7 @@ # just the public properties are accessible via the configure interface # - ? {o1 configure} { ?-e value? ?-a value? ?-b value? ?-volatile? ?-noinit? ?-object-mixin mixinreg ...? ?-class class? ?-object-filter filterreg ...? ?__initcmd?} + ? {o1 configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initcmd/?} # # just the public properties are accessible via the cget interface @@ -518,7 +518,7 @@ # # The use of "-incremental" implies multivalued # - ? {o1 configure} { ?-e value ...? ?-a value ...? ?-b value ...? ?-volatile? ?-noinit? ?-object-mixin mixinreg ...? ?-class class? ?-object-filter filterreg ...? ?__initcmd?} + ? {o1 configure} { ?-e /value .../? ?-a /value .../? ?-b /value .../? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initcmd/?} ? {o1 cget -a} a1 ? {o1 cget -b} b1 @@ -682,12 +682,12 @@ # just the public properties are accessible via the configure interface # - ? {c1 configure} {?-a value? ?-volatile? ?-noinit? ?-object-mixin mixinreg ...? ?-class class? ?-object-filter filterreg ...? ?__initcmd?} + ? {c1 configure} {?-a /value/? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initcmd/?} ? {c1 cget -a} a1 ? {c1 configure -a a2} "" - ? {C configure} {?-b value? ?-superclass class ...? ?-mixin mixinreg ...? ?-filter filterreg ...? ?-volatile? ?-noinit? ?-object-mixin mixinreg ...? ?-class class? ?-object-filter filterreg ...? ?__initcmd?} + ? {C configure} {?-b /value/? ?-superclass /class .../? ?-mixin /mixinreg .../? ?-filter /filterreg .../? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initcmd/?} ? {C cget -b} b1 ? {C configure -b b2} "" @@ -741,7 +741,7 @@ # just the public properties are accessible via the configure interface # - ? {c1 configure} { ?-e value? ?-a value? ?-b value? ?-volatile? ?-noinit? ?-object-mixin mixinreg ...? ?-class class? ?-object-filter filterreg ...? ?__initcmd?} + ? {c1 configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initcmd/?} set e [C eval :__objectparameter] ? {C eval :__objectparameter} $e @@ -760,7 +760,7 @@ # # check influence of class-level per-object properties # - ? {d1 configure} { ?-e value? ?-a value? ?-b value? ?-volatile? ?-noinit? ?-object-mixin mixinreg ...? ?-class class? ?-object-filter filterreg ...? ?__initcmd?} + ? {d1 configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initcmd/?} set e [D eval :__objectparameter] ? {D eval :__objectparameter} $e @@ -800,7 +800,7 @@ # just the public properties are accessible via the configure interface # - ? {o1 configure} { ?-e value? ?-a value? ?-b value? ?-volatile? ?-noinit? ?-object-mixin mixinreg ...? ?-class class? ?-object-filter filterreg ...? ?__initcmd?} + ? {o1 configure} { ?-e /value/? ?-a /value/? ?-b /value/? ?-volatile? ?-noinit? ?-object-mixin /mixinreg .../? ?-class /class/? ?-object-filter /filterreg .../? ?/__initcmd/?} set e [o1 eval :__objectparameter]