#45 Relative level in idebug

open
Jeffrey Hobbs
tkcon (26)
6
2012-03-07
2012-03-01
Andy Goth
No

The idebug commands accept both absolute and relative levels, preceded by # and -, respectively. However, the - notation doesn't work, since [uplevel] doesn't support that syntax. Here's a possible fix, added to the [if] that extracts $lvl from $line.

} elseif {[string match -* $lvl]} {
set lvl [expr {2 + [string range $lvl 1 end]}]

Discussion

  • Jeffrey Hobbs
    Jeffrey Hobbs
    2012-03-07

    I'm not even sure what I was thinking here anymore. I would say that it shouldn't recognize '-' at all, because it's really just about representing an uplevel level, and we have relative (1, 2, 3) and absolute #. Oh wait, that's for passing to the idebug commands only. e.g. '-1 v' might give us the vars in the previous scope.

    In fact, it looks like that bit of level magic code never worked. If we did get a match, we should have a clause that alters $key to the next word.

    Agreed?

     
  • Jeffrey Hobbs
    Jeffrey Hobbs
    2012-03-07

    • priority: 5 --> 6