Index: generic/xotcl.c =================================================================== diff -u -r147831f1098cb9b96a28d4d5b0f9f3ccea35b9da -r0e4d8c600ce1f742ffe04041b7db56bde53c20d6 --- generic/xotcl.c (.../xotcl.c) (revision 147831f1098cb9b96a28d4d5b0f9f3ccea35b9da) +++ generic/xotcl.c (.../xotcl.c) (revision 0e4d8c600ce1f742ffe04041b7db56bde53c20d6) @@ -6399,11 +6399,24 @@ } else if (strncmp(option, "method", 6) == 0) { paramPtr->flags |= XOTCL_ARG_METHOD; } else if (strncmp(option, "multivalued", 11) == 0) { + if ((paramPtr->flags & (XOTCL_ARG_INITCMD|XOTCL_ARG_RELATION|XOTCL_ARG_METHOD|XOTCL_ARG_SWITCH)) != 0) + return XOTclVarErrMsg(interp, + "option multivalued not allowed for \"initcmd\", \"method\", \"relation\" or \"switch\"\n", + (char *) NULL); paramPtr->flags |= XOTCL_ARG_MULTIVALUED; } else if (strncmp(option, "noarg", 5) == 0) { + if ((paramPtr->flags & XOTCL_ARG_METHOD) == 0) { + return XOTclVarErrMsg(interp, "option noarg only allowed for parameter type \"method\"", + (char *) NULL); + } paramPtr->flags |= XOTCL_ARG_NOARG; paramPtr->nrArgs = 0; } else if (length >= 5 && strncmp(option, "arg=", 4) == 0) { + if ((paramPtr->flags & (XOTCL_ARG_METHOD|XOTCL_ARG_RELATION)) == 0 + && paramPtr->converter != convertViaCmd) + return XOTclVarErrMsg(interp, + "option arg= only allowed for \"method\", \"relation\" or \"user-defined converter\"", + (char *) NULL); paramPtr->converterArg = Tcl_NewStringObj(option+4, length-4); INCR_REF_COUNT(paramPtr->converterArg); } else if (strncmp(option, "switch", 6) == 0) { Index: tests/parameters.xotcl =================================================================== diff -u -r6392a9deba783dd17186ca2ba94c22f90267d79c -r0e4d8c600ce1f742ffe04041b7db56bde53c20d6 --- tests/parameters.xotcl (.../parameters.xotcl) (revision 6392a9deba783dd17186ca2ba94c22f90267d79c) +++ tests/parameters.xotcl (.../parameters.xotcl) (revision 0e4d8c600ce1f742ffe04041b7db56bde53c20d6) @@ -46,8 +46,8 @@ # noarg # arg= # substdefault: if no value given, subst on default (result is substituted value); -# can use variable resolvers, -# for scripted/c-methods/obj-parm, +# susbt cmd can use variable resolvers, +# works for scripted/c-methods and obj-parm, # autmatically set by "$slot toParameterSyntax" if default contains "[" ... "]". # # initcmd: evaluate body in an xotcl nonleaf frame, called via configure @@ -56,20 +56,20 @@ # specified value is the first argument unless "noarg" is used # (example: -noinit). # -# parameter type multivalued required noarg type= arg= valueCheck methodParm objectParm -# initcmd NO YES NO NO NO NO NO/POSSIBLE YES -# method NO YES YES NO YES NO NO/POSSIBLE YES +# parameter type multivalued required noarg type= arg= valueCheck methodParm objectParm +# initcmd NO YES NO NO NO NO NO/POSSIBLE YES +# method NO YES YES NO YES NO NO/POSSIBLE YES # -# relation NO YES NO NO YES NO NO YES -# stringtype YES YES NO NO NO YES YES YES +# relation NO YES NO NO YES NO NO YES +# stringtype YES YES NO NO NO YES YES YES # -# switch NO NO NO NO NO NO YES YES -# integer YES YES NO NO NO YES YES YES -# boolean YES YES NO NO NO YES YES YES -# object YES YES NO YES NO YES YES YES -# class YES YES NO YES NO YES YES YES +# switch NO NO NO NO NO NO YES YES +# integer YES YES NO NO NO YES YES YES +# boolean YES YES NO NO NO YES YES YES +# object YES YES NO YES NO YES YES YES +# class YES YES NO YES NO YES YES YES # -# userdefined YES YES NO NO YES YES YES YES +# userdefined YES YES NO NO YES YES YES YES # # tclObj + converterArg (alnum..xdigit) Attribute ... -type alnum # object + converterArg (some class, e.g. ::C) Attribute ... -type ::C Attribute -type object -arg ::C