Browse Source

repl - avoid unnecessary string rep conversion to aid analysis using tcl::unsupported::representation

master
Julian Noble 2 years ago
parent
commit
e30e834bf8
  1. 13
      src/punk86.vfs/lib/app-punk/repl.tcl

13
src/punk86.vfs/lib/app-punk/repl.tcl

@ -1040,8 +1040,19 @@ proc repl::repl_handler {inputchan prompt_config} {
}
} else {
#-----------------------------------------------------------
# avoid repl forcing string rep of simple results. This is just to aid analysis using tcl::unsupported::representation
set rparts [split $result {}]
if {[lsearch $rparts \n] < 0} {
#type of $result unaffected
rputs "$resultprompt $result"
} else {
#$result will be a string due to use of string map
rputs $resultprompt[string map [list \n "\n$resultprompt"] $result]
}
#-----------------------------------------------------------
#rputs $resultprompt[string map [list \n "\n$resultprompt"] $result]
}
doprompt "P% "
} else {
#tcl err
@ -1090,7 +1101,7 @@ proc repl::repl_handler {inputchan prompt_config} {
rputs stderr "${c}repl interrupted$n"
#set command [list error "repl interrupted"]
set command ""
doprompt ">_"
doprompt ">_ "
} else {
doprompt "> "

Loading…
Cancel
Save