Index: openacs-4/packages/acs-tcl/tcl/xml-0-sgml-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/xml-0-sgml-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-tcl/tcl/xml-0-sgml-procs.tcl 26 Jan 2004 15:39:46 -0000 1.2 +++ openacs-4/packages/acs-tcl/tcl/xml-0-sgml-procs.tcl 10 Jan 2007 21:22:12 -0000 1.3 @@ -389,7 +389,7 @@ # Get the version number if {[regexp {[ ]*version="(-+|[a-zA-Z0-9_.:]+)"[ ]*} $param discard version] || [regexp {[ ]*version='(-+|[a-zA-Z0-9_.:]+)'[ ]*} $param discard version]} { - if {[string compare $version "1.0"]} { + if {$version ne "1.0" } { # Should we support future versions? # At least 1.X? uplevel #0 $options(-errorcommand) "document XML version \"$version\" is incompatible with XML version 1.0" @@ -605,7 +605,7 @@ # Parse attribute list into a key-value representation if {[string compare $options(-parseattributelistcommand) {}]} { if {[catch {uplevel #0 $options(-parseattributelistcommand) [list $attr]} attr]} { - if {[string compare [lindex $attr 0] "unterminated attribute value"]} { + if {[lindex $attr 0] ne "unterminated attribute value" } { uplevel #0 $options(-errorcommand) [list $attr around line $state(line)] set attr {} } else { @@ -682,7 +682,7 @@ array set cfg $args # WF check - if {[string compare $tag [lindex $state(stack) end]]} { + if {$tag ne [lindex $state(stack) end] } { uplevel #0 $options(-errorcommand) [list "end tag \"$tag\" does not match open element \"[lindex $state(stack) end]\" around line $state(line)"] return } @@ -1047,7 +1047,7 @@ } start=| - start=, { - set var(state) [lreplace $var(state) end end [expr {$cs == "," ? ":seq" : ":choice"}]] + set var(state) [lreplace $var(state) end end [expr {$cs eq "," ? ":seq" : ":choice"}]] CModelSTcsSet $state $cs CModelSTcpAdd $state $cp $rep } @@ -1057,7 +1057,7 @@ } :choice=, - :seq=| { - return -code error "syntax error in specification: incorrect delimiter after \"$cp\", should be \"[expr {$cs == "," ? "|" : ","}]\"" + return -code error "syntax error in specification: incorrect delimiter after \"$cp\", should be \"[expr {$cs eq "," ? "|" : ","}]\"" } end=* { return -code error "syntax error in specification: no delimiter before \"$cp\"" @@ -1083,7 +1083,7 @@ proc sgml::CModelSTcsSet {state cs} { upvar #0 $state var - set cs [expr {$cs == "," ? ":seq" : ":choice"}] + set cs [expr {$cs eq "," ? ":seq" : ":choice"}] if {[llength $var(stack)]} { set var(stack) [lreplace $var(stack) end end $cs] @@ -1279,9 +1279,9 @@ :seq { for {set i 1} {$i < [llength [lindex $st 1]]} {incr i} { followpos $state [lindex [lindex $st 1] $i] \ - [lindex [lindex $firstpos 0] [expr $i - 1]] \ - [lindex [lindex $lastpos 0] [expr $i - 1]] - foreach pos [lindex [lindex [lindex $lastpos 0] [expr $i - 1]] 1] { + [lindex [lindex $firstpos 0] [expr {$i - 1}]] \ + [lindex [lindex $lastpos 0] [expr {$i - 1}]] + foreach pos [lindex [lindex [lindex $lastpos 0] [expr {$i - 1}]] 1] { eval lappend var($pos) [lindex [lindex [lindex $firstpos 0] $i] 1] set var($pos) [makeSet $var($pos)] } @@ -1290,8 +1290,8 @@ :choice { for {set i 1} {$i < [llength [lindex $st 1]]} {incr i} { followpos $state [lindex [lindex $st 1] $i] \ - [lindex [lindex $firstpos 0] [expr $i - 1]] \ - [lindex [lindex $lastpos 0] [expr $i - 1]] + [lindex [lindex $firstpos 0] [expr {$i - 1}]] \ + [lindex [lindex $lastpos 0] [expr {$i - 1}]] } } default { @@ -1380,7 +1380,7 @@ set result [lindex [lindex $firstpos 0] 1] for {set i 0} {$i < [llength $nullable]} {incr i} { if {[lindex [lindex $nullable $i] 1]} { - eval lappend result [lindex [lindex $firstpos [expr $i + 1]] 1] + eval lappend result [lindex [lindex $firstpos [expr {$i + 1}]] 1] } else { break } @@ -1413,7 +1413,7 @@ switch -- $cs { :seq { set result [lindex [lindex $lastpos end] 1] - for {set i [expr [llength $nullable] - 1]} {$i >= 0} {incr i -1} { + for {set i [expr {[llength $nullable] - 1}]} {$i >= 0} {incr i -1} { if {[lindex [lindex $nullable $i] 1]} { eval lappend result [lindex [lindex $lastpos $i] 1] } else { @@ -1483,13 +1483,13 @@ :choice { set result 0 foreach child $subtree { - set result [expr $result || [lindex $child 1]] + set result [expr {$result || [lindex $child 1]}] } } :seq { set result 1 foreach child $subtree { - set result [expr $result && [lindex $child 1]] + set result [expr {$result && [lindex $child 1]}] } } } @@ -1581,7 +1581,7 @@ upvar opts state upvar entities ents - if {[string compare % $id]} { + if {"%" ne $id } { # Entity declaration if {[info exists ents($id)]} { eval $state(-errorcommand) entity [list "entity \"$id\" already declared"]