Index: TODO =================================================================== diff -u -r448c0563adb3705d6686bdb37dc316f37b325474 -r2a2ccb5fb66078bf66fbd242592165cc43f7b87d --- TODO (.../TODO) (revision 448c0563adb3705d6686bdb37dc316f37b325474) +++ TODO (.../TODO) (revision 2a2ccb5fb66078bf66fbd242592165cc43f7b87d) @@ -1625,11 +1625,16 @@ (i.e. from all classes along the precedence order. It was necessary to pass calling object as first argument) +- "info method parametersyntax" returns now for all nonpos args the + type instead of "arg" when possible (eg ..... ?-x object? ....) +- extended regression test + TODO: -- handing of xo::at_cleanup in serializer - (either generailization or move to OpenACS/aolserver init/naviserver init) + + - cleanup of xotcl-aol + - method-modifiers/attribute-method.002: incorrect result for 'set _ {}' expected: '::C::A', got '' in test file ./tests/method-modifiers.tcl @@ -1647,7 +1652,9 @@ * handle subcmd for other method factories * handle absence of -create flag in resolve_method_path (for introspection) - serializer: - keep track of defaultMethodProtection + * keep track of defaultMethodProtection + * handing of xo::at_cleanup in serializer + (either generailization or move to OpenACS/aolserver init/naviserver init) - interfaces in documentation for slots (see for more details ::nx::Class#superclass in nx.tcl). @@ -1706,7 +1713,7 @@ - integrate ::nx::doc::make with Makefile.in (provide shell calls and, targets and dependencies) - decide on syntax in documentation - (info method parameter | info method parametersyntax | mixture, e.g. parmetersyntax with value-checkers) + (info method parameter | info method parametersyntax) - reduce indenting for code examples in documentation (high indentation makes readability worse). i use usually jsut 2, 4 are ok as well; we should decide. Index: generic/nsf.c =================================================================== diff -u -r448c0563adb3705d6686bdb37dc316f37b325474 -r2a2ccb5fb66078bf66fbd242592165cc43f7b87d --- generic/nsf.c (.../nsf.c) (revision 448c0563adb3705d6686bdb37dc316f37b325474) +++ generic/nsf.c (.../nsf.c) (revision 2a2ccb5fb66078bf66fbd242592165cc43f7b87d) @@ -150,8 +150,9 @@ NsfObject *object; } ParseContext; -static NsfTypeConverter ConvertToNothing; +static NsfTypeConverter ConvertToNothing, ConvertViaCmd; + /* * Tcl_Obj Types for Next Scripting Objects */ @@ -6023,7 +6024,28 @@ Tcl_AppendLimitedToObj(argStringObj, "?", 1, INT_MAX, NULL); Tcl_AppendLimitedToObj(argStringObj, pPtr->name, -1, INT_MAX, NULL); if (pPtr->nrArgs >0) { - Tcl_AppendLimitedToObj(argStringObj, " arg", 4, INT_MAX, NULL); + if (pPtr->type) { + Tcl_AppendLimitedToObj(argStringObj, " ", 1, INT_MAX, NULL); + + if (pPtr->converter == ConvertViaCmd) { + Tcl_AppendLimitedToObj(argStringObj, pPtr->type + 5, -1, INT_MAX, NULL); + } else if (strcmp(pPtr->type, "stringtype") == 0) { + if (pPtr->converterArg) { + Tcl_AppendLimitedToObj(argStringObj, ObjStr(pPtr->converterArg), -1, INT_MAX, NULL); + } else { + Tcl_AppendLimitedToObj(argStringObj, "arg", 3, INT_MAX, NULL); + } + } else { + Tcl_AppendLimitedToObj(argStringObj, pPtr->type, -1, INT_MAX, NULL); + } + + } else { + Tcl_AppendLimitedToObj(argStringObj, " arg", 4, INT_MAX, NULL); + } + if (pPtr->flags & NSF_ARG_MULTIVALUED) { + Tcl_AppendLimitedToObj(argStringObj, " list", 5, INT_MAX, NULL); + } + //fprintf(stderr, "type of %s = %s\n",pPtr->name,pPtr->type); } Tcl_AppendLimitedToObj(argStringObj, "?", 1, INT_MAX, NULL); } Index: tests/parameters.tcl =================================================================== diff -u -r29a6e282641a301a6dbe3dfea315ec285456661d -r2a2ccb5fb66078bf66fbd242592165cc43f7b87d --- tests/parameters.tcl (.../parameters.tcl) (revision 29a6e282641a301a6dbe3dfea315ec285456661d) +++ tests/parameters.tcl (.../parameters.tcl) (revision 2a2ccb5fb66078bf66fbd242592165cc43f7b87d) @@ -1297,3 +1297,26 @@ ? {c1 f32} 1 } +Test case check-arguments { + + Class create Foo { + :method noarg {} {return ""} + :method onearg {-x} {return $x} + :method intarg {-x:integer} {return $x} + :method intsarg {-x:integer,multivalued} {return $x} + :method boolarg {-x:boolean} {return $x} + :method classarg {-x:class} {return $x} + :method upperarg {-x:upper} {return $x} + :method metaclassarg {-x:metaclass} {return $x} + } + + ? {Foo info method parametersyntax noarg} "" + ? {Foo info method parametersyntax onearg} "?-x arg?" + ? {Foo info method parametersyntax intarg} "?-x integer?" + ? {Foo info method parametersyntax intsarg} "?-x integer list?" + ? {Foo info method parametersyntax boolarg} "?-x boolean?" + ? {Foo info method parametersyntax classarg} "?-x class?" + ? {Foo info method parametersyntax upperarg} "?-x upper?" + ? {Foo info method parametersyntax metaclassarg} "?-x metaclass?" + +} \ No newline at end of file