Update tclpro; add a test

This commit is contained in:
Ben Jackson 2020-07-08 13:19:14 +01:00
commit 402071065f
4 changed files with 68 additions and 2 deletions

View file

@ -0,0 +1,5 @@
instrument::addExtension 2.0 {test}
instrument::addCommand Wrap { parseBody }
# vim: ft=tcl

View file

@ -0,0 +1,11 @@
{
"configurations": {
"Run Current Script": {
"adapter": "tclpro",
"configuration": {
"request": "launch",
"target": "${file}"
}
}
}
}

28
support/test/tcl/test Normal file
View file

@ -0,0 +1,28 @@
#!/usr/bin/env tclsh
set SCALAR g
array set ARRAY {key1 value1 key2 value2}
proc Wrap { body } {
uplevel 1 $body
}
proc Main {} {
global SCALAR
set prefix "VAR: "
Wrap {
puts $SCALAR
global ARRAY
puts [array names ARRAY]
set vars [list]
foreach n [array names ::env] {
set prefix "ENVVAR: $n = "
puts "$prefix $::env($n)"
lappend vars $n
}
}
puts $vars
}
Main