https://issues.apache.org/bugzilla/show_bug.cgi?id=52633
Bug #: 52633
Summary: simpledb puts "...". tcl error
Product: Rivet
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: minor
Priority: P2
Component: Rivet
AssignedTo: [email protected]
ReportedBy: [email protected]
Classification: Unclassified
I scanned the packages within Rivet using Komodo and the syntax checker
reported the following errors and remarks:
File |Type |Line|Remark
simpledb.tcl |Error |301 |Point after closing quote
simpledb.tcl |Warning|200 |Variable "props" unknown
simpledb.tcl |Warning|202 |Variable "props" unknown
simpledb.tcl |Warning|240 |Avoid nesting of expr (1)
tclrivet.tcl |Warning|24 |Proc ||include redefined
tclrivetparser.tcl|Error |106 |extra character after closed brace (2)
tclrivetparser.tcl|Error |112 |missing " (3)
cookie.tcl |Warning|40 |Use {} to avoid double substitution (4)
cookie.tcl |Warning|41 |Use {} to avoid double substitution (5)
cookie.tcl |Warning|45 |Use {} to avoid double substitution (6)
html.tcl |Warning|20 |Use {} to avoid double substitution (7)
import_key_value_pairs.tcl
|Warning|37 |Use {} to avoid double substitution (8)
import_switch_args.tcl
|Warning|22 |Undefined variable "args"
|Warning|26 |Use {} to avoid double substitution (9)
lassign.tcl |Warning|11 |Redefines proc (10)
lempty |Warning|13 |Use {} to avoid double substitution (11)
(1)
Original:
if { $res($oid) == [expr {[llength $propertymatch] / 2}] } {
Proposed change:
if { $res($oid) == [llength $propertymatch] / 2 } {
(2,3)
As this is correctly interpreted by TCL, there is no need for action.
Nevertheless, I would add an additional "\" before { and [:
Originals:
append outbuf "\\}"
append outbuf "\\["
Proposed change:
append outbuf "\\\}"
append outbuf "\\\["
(4)
This is helpful for the bytecode compiler, so it is not idiot.
Original:
if [info exists params($time)] {
Proposed change:
if {[info exists params($time)]} {
(5)
Original:
incr expiresIn [expr $params($time) * $num]
Proposed change:
incr expiresIn [expr {$params($time) * $num} ]
(6)
Original:
set secs [expr [clock seconds] + $expiresIn]
Proposed change:
set secs [expr {[clock seconds] + $expiresIn} ]
(7)
Original:
for {set i [expr [llength $args] - 1]} {$i >= 0} {incr i -1} {
Proposed change:
for {set i [expr {[llength $args] - 1} ]} {$i >= 0} {incr i -1} {
(8)
Original:
set data(args) [lrange $argsList [expr $index + 1] end]
Proposed change:
set data(args) [lrange $argsList [expr {$index + 1}] end]
(9)
Original:
set array(args) [lrange $argsList [expr $index + 1] end]
Proposed change:
set array(args) [lrange $argsList [expr {$index + 1}] end]
or TCL8.5+:
set array(args) [lrange $argsList $index+1 end]
(10)
As lassign is defined in tcl 8.5, one may code a check here:
Proposed change:
if {0 == [llength [info commands lassign]]} {
proc lassign...
}
(11)
expr $len == 0 -> expr {$len == 0}
I am sorry, this got long and eventually enervous.
If ok for the community, I may make the changes.
Regards,
Harald
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]