summaryrefslogtreecommitdiffstats
path: root/ds9/library/util.tcl
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-05-08 20:49:47 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2018-05-08 20:49:47 (GMT)
commit3df839da664ea2addc7ccc6d7868dc55b0ee279b (patch)
tree74ca46807bbf44eb0214c3c71c5f10d7e49e6666 /ds9/library/util.tcl
parent00025e4e4f0b0469fc6c3bd5ffb4ef3e457fd30f (diff)
downloadblt-3df839da664ea2addc7ccc6d7868dc55b0ee279b.zip
blt-3df839da664ea2addc7ccc6d7868dc55b0ee279b.tar.gz
blt-3df839da664ea2addc7ccc6d7868dc55b0ee279b.tar.bz2
add ds9 source parser
Diffstat (limited to 'ds9/library/util.tcl')
-rw-r--r--ds9/library/util.tcl17
1 files changed, 14 insertions, 3 deletions
diff --git a/ds9/library/util.tcl b/ds9/library/util.tcl
index dfb7991..5a67d90 100644
--- a/ds9/library/util.tcl
+++ b/ds9/library/util.tcl
@@ -1650,13 +1650,24 @@ proc ProcessSleepCmd {varname iname} {
proc ProcessSourceCmd {varname iname} {
upvar $varname var
upvar $iname i
- SourceCmd [lindex $var $i]
-}
-proc SourceCmd {fn} {
# we need to be realized
# you never know what someone will try to do
ProcessRealizeDS9
+
+ global debug
+ if {$debug(tcl,parser)} {
+ source::YY_FLUSH_BUFFER
+ source::yy_scan_string [lrange $var $i end]
+ source::yyparse
+ incr i [expr $source::yycnt-1]
+ } else {
+
+ uplevel #0 "source [lindex $var $i]"
+}
+}
+
+proc SourceCmd {fn} {
uplevel #0 "source $fn"
}