summaryrefslogtreecommitdiffstats
path: root/tools/genStubs.tcl
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-02-07 22:16:54 (GMT)
committernijtmans <nijtmans>2010-02-07 22:16:54 (GMT)
commit1c013bdae2c36d6eb441377358453d1f215efc04 (patch)
tree316d405bed78afb8a81c60b2c1cd925b2afcdb46 /tools/genStubs.tcl
parent6954a8f786583ef8688ed40c560be6dd5125ad12 (diff)
downloadtcl-1c013bdae2c36d6eb441377358453d1f215efc04.zip
tcl-1c013bdae2c36d6eb441377358453d1f215efc04.tar.gz
tcl-1c013bdae2c36d6eb441377358453d1f215efc04.tar.bz2
Backport various formatting (spacing)
changes from HEAD, so diffing between 8.5.x and 8.6 shows the real structural differences again. (any signature change not backported!)
Diffstat (limited to 'tools/genStubs.tcl')
-rw-r--r--tools/genStubs.tcl38
1 files changed, 25 insertions, 13 deletions
diff --git a/tools/genStubs.tcl b/tools/genStubs.tcl
index 5e3eba2..911f2b5 100644
--- a/tools/genStubs.tcl
+++ b/tools/genStubs.tcl
@@ -10,7 +10,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: genStubs.tcl,v 1.22.2.3 2009/12/02 22:01:07 nijtmans Exp $
+# RCS: @(#) $Id: genStubs.tcl,v 1.22.2.4 2010/02/07 22:16:54 nijtmans Exp $
package require Tcl 8.4
@@ -424,7 +424,7 @@ proc genStubs::makeDecl {name decl index} {
append text ";\n"
return $text
}
- append line "$fname "
+ append line $fname
set arg1 [lindex $args 0]
switch -exact $arg1 {
@@ -436,11 +436,14 @@ proc genStubs::makeDecl {name decl index} {
foreach arg [lrange $args 1 end] {
append line $sep
set next {}
- append next [lindex $arg 0] " " [lindex $arg 1] \
- [lindex $arg 2]
+ append next [lindex $arg 0]
+ if {[string index $next end] ne "*"} {
+ append next " "
+ }
+ append next [lindex $arg 1] [lindex $arg 2]
if {[string length $line] + [string length $next] \
+ $pad > 76} {
- append text $line \n
+ append text [string trimright $line] \n
set line "\t\t\t\t"
set pad 28
}
@@ -454,11 +457,14 @@ proc genStubs::makeDecl {name decl index} {
foreach arg $args {
append line $sep
set next {}
- append next [lindex $arg 0] " " [lindex $arg 1] \
- [lindex $arg 2]
+ append next [lindex $arg 0]
+ if {[string index $next end] ne "*"} {
+ append next " "
+ }
+ append next [lindex $arg 1] [lindex $arg 2]
if {[string length $line] + [string length $next] \
+ $pad > 76} {
- append text $line \n
+ append text [string trimright $line] \n
set line "\t\t\t\t"
set pad 28
}
@@ -603,8 +609,11 @@ proc genStubs::makeSlot {name decl index} {
TCL_VARARGS {
set sep "("
foreach arg [lrange $args 1 end] {
- append text $sep [lindex $arg 0] " " [lindex $arg 1] \
- [lindex $arg 2]
+ append text $sep [lindex $arg 0]
+ if {[string index $text end] ne "*"} {
+ append text " "
+ }
+ append text [lindex $arg 1] [lindex $arg 2]
set sep ", "
}
append text ", ...)"
@@ -612,8 +621,11 @@ proc genStubs::makeSlot {name decl index} {
default {
set sep "("
foreach arg $args {
- append text $sep [lindex $arg 0] " " [lindex $arg 1] \
- [lindex $arg 2]
+ append text $sep [lindex $arg 0]
+ if {[string index $text end] ne "*"} {
+ append text " "
+ }
+ append text [lindex $arg 1] [lindex $arg 2]
set sep ", "
}
append text ")"
@@ -1158,7 +1170,7 @@ proc genStubs::init {} {
if {[string length [namespace which lassign]] == 0} {
proc lassign {valueList args} {
if {[llength $args] == 0} {
- error "wrong # args: lassign list varname ?varname..?"
+ error "wrong # args: should be \"lassign list varName ?varName ...?\""
}
uplevel [list foreach $args $valueList {break}]
return [lrange $valueList [llength $args] end]