Index: ChangeLog =================================================================== diff -u -r986b0a08b5168612ef730a8b575ddbffee9f0b14 -r897518a3e8bf901a40ef84b016597bf8ec476e1b --- ChangeLog (.../ChangeLog) (revision 986b0a08b5168612ef730a8b575ddbffee9f0b14) +++ ChangeLog (.../ChangeLog) (revision 897518a3e8bf901a40ef84b016597bf8ec476e1b) @@ -1,3 +1,8 @@ +2012-01-16 + * xotcl.c Extend backport of handling of dashses in XOTcl's + configure method to perform a more eager search for command + begins. Extended regression test + 2012-01-14 * xotcl.c Don't overwrite error messages from __unknown handler in several situations (superclass, parameter class, mixin class) Index: generic/xotcl.c =================================================================== diff -u -r986b0a08b5168612ef730a8b575ddbffee9f0b14 -r897518a3e8bf901a40ef84b016597bf8ec476e1b --- generic/xotcl.c (.../xotcl.c) (revision 986b0a08b5168612ef730a8b575ddbffee9f0b14) +++ generic/xotcl.c (.../xotcl.c) (revision 897518a3e8bf901a40ef84b016597bf8ec476e1b) @@ -10458,7 +10458,7 @@ } } flag = ObjStr(obj); - /*fprintf(stderr, "we have a scalar '%s'\n", flag);*/ + /*fprintf(stderr, "we have a scalar '%s' firstArg %d\n", flag, firstArg);*/ if ((*flag == '-') && isalpha(*((flag)+1))) { if (firstArg) { @@ -10531,10 +10531,10 @@ for( ; i < objc; argc=nextArgc, argv=nextArgv, methodName=nextMethodName) { Tcl_ResetResult(interp); switch (isdasharg) { - case SKALAR_DASH: /* argument is a skalar with a leading dash */ + case SKALAR_DASH: /* argument is a skalar with a leading dash, eager search for dashed arg */ { int j; for (j = i+1; j < objc; j++, argc++) { - if ((isdasharg = isDashArg(interp, objv[j], j==i+1, &nextMethodName, &nextArgc, &nextArgv))) + if ((isdasharg = isDashArg(interp, objv[j], 1, &nextMethodName, &nextArgc, &nextArgv))) break; } result = callConfigureMethod(interp, obj, methodName, argc+1, objv+i+1); Index: tests/speedtest.xotcl =================================================================== diff -u -ra976b7c6a116f584114d2612494aaaa8e8028387 -r897518a3e8bf901a40ef84b016597bf8ec476e1b --- tests/speedtest.xotcl (.../speedtest.xotcl) (revision a976b7c6a116f584114d2612494aaaa8e8028387) +++ tests/speedtest.xotcl (.../speedtest.xotcl) (revision 897518a3e8bf901a40ef84b016597bf8ec476e1b) @@ -497,6 +497,27 @@ -post {A destroy; a1 destroy} +Test new -msg {test multiple dashed args} \ + -pre {::Class create Person} \ + -cmd {Person create p0 [list -set a -a1] [list -set b "-b 1 -y 2"]} \ + -expected ::p0 \ + -post {Person destroy} +Test new -msg {test multiple dashed args} \ + -pre {::Class create Person} \ + -cmd {Person create p1 Person create p1 -proc foo args {return 1} [list -set a -a1] [list -set b "-b 1 -y 2"]} \ + -expected ::p1 \ + -post {Person destroy} +Test new -msg {test multiple dashed args} \ + -pre {::Class create Person -parameter {a b}} \ + -cmd {Person create p2 {-proc foo args {return 1}} {-set -a -t1} {-set b "-b 1 -y 2"}} \ + -expected ::p2 \ + -post {Person destroy} +Test new -msg {test multiple dashed args} \ + -pre {::Class create Person -parameter {a b}} \ + -cmd {Person create p3 -proc foo args {return 1} {-set -a -t1} {-set b "-b 1 -y 2"}} \ + -expected ::p3 \ + -post {Person destroy} + Test run; exit