diff options
Diffstat (limited to 'library/word.tcl')
-rw-r--r-- | library/word.tcl | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/library/word.tcl b/library/word.tcl index 64639f2..56fca90 100644 --- a/library/word.tcl +++ b/library/word.tcl @@ -9,7 +9,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# SCCS: @(#) word.tcl 1.2 96/11/20 14:07:22 +# SCCS: %Z% $Id: word.tcl,v 1.2 1998/06/27 18:11:26 welch Exp $ # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -42,8 +42,8 @@ if {$tcl_platform(platform) == "windows"} { proc tcl_wordBreakAfter {str start} { global tcl_nonwordchars tcl_wordchars set str [string range $str $start end] - if [regexp -indices "$tcl_wordchars$tcl_nonwordchars|$tcl_nonwordchars$tcl_wordchars" $str result] { - return [expr [lindex $result 1] + $start] + if {[regexp -indices "$tcl_wordchars$tcl_nonwordchars|$tcl_nonwordchars$tcl_wordchars" $str result]} { + return [expr {[lindex $result 1] + $start}] } return -1 } @@ -64,7 +64,7 @@ proc tcl_wordBreakBefore {str start} { if {[string compare $start end] == 0} { set start [string length $str] } - if [regexp -indices "^.*($tcl_wordchars$tcl_nonwordchars|$tcl_nonwordchars$tcl_wordchars)" [string range $str 0 $start] result] { + if {[regexp -indices "^.*($tcl_wordchars$tcl_nonwordchars|$tcl_nonwordchars$tcl_wordchars)" [string range $str 0 $start] result]} { return [lindex $result 1] } return -1 @@ -84,9 +84,9 @@ proc tcl_wordBreakBefore {str start} { proc tcl_endOfWord {str start} { global tcl_nonwordchars tcl_wordchars - if [regexp -indices "$tcl_nonwordchars*$tcl_wordchars+$tcl_nonwordchars" \ - [string range $str $start end] result] { - return [expr [lindex $result 1] + $start] + if {[regexp -indices "$tcl_nonwordchars*$tcl_wordchars+$tcl_nonwordchars" \ + [string range $str $start end] result]} { + return [expr {[lindex $result 1] + $start}] } return -1 } @@ -105,9 +105,9 @@ proc tcl_endOfWord {str start} { proc tcl_startOfNextWord {str start} { global tcl_nonwordchars tcl_wordchars - if [regexp -indices "$tcl_wordchars*$tcl_nonwordchars+$tcl_wordchars" \ - [string range $str $start end] result] { - return [expr [lindex $result 1] + $start] + if {[regexp -indices "$tcl_wordchars*$tcl_nonwordchars+$tcl_wordchars" \ + [string range $str $start end] result]} { + return [expr {[lindex $result 1] + $start}] } return -1 } @@ -126,9 +126,9 @@ proc tcl_startOfPreviousWord {str start} { if {[string compare $start end] == 0} { set start [string length $str] } - if [regexp -indices \ + if {[regexp -indices \ "$tcl_nonwordchars*($tcl_wordchars+)$tcl_nonwordchars*\$" \ - [string range $str 0 [expr $start - 1]] result word] { + [string range $str 0 [expr {$start - 1}]] result word]} { return [lindex $word 0] } return -1 |