global SaveLine Sep space spat set SaveLine {} set Sep { } set space { } set spat {^([ ]+)} # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # proc xcpt {} { global in Src Script scripts if {$in(comment)} { if [regsub {.*-->} $Src {} Src] { incr in(comment) -1 incr in(except) -1 } else { set Src {} } } elseif {$in(SCRIPT)} { if [regexp -nocase {(.*)} $Src {} i Src] { if {$i != {}} {append Script($scripts) $i} incr in(SCRIPT) -1 incr in(except) -1 } else { append Script($scripts) $Src set Src {} } } } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # Interpret a chunk of text as HTML and append its formatted value to the # window. We normally get just one line at a time here. We strip off chunk # one at a time, and feed them to various routines for processing. We # distinguish mainly between three types of text chunks: # 1. White space. # 2. HTML tags. # 3. Other text. # proc docLine {w x} { global V me Cols SP Rows LC wantNL in white SaveLine scripts Script space spat Src global curD Txt TxtLen TxtMaxw if {$V>1} {set id "$me/docLine"} set Src "$SaveLine$x" set SaveLine {} if {$V>2} {puts "$id: ============================================================="} if {$V>4} {puts "$id: Src=\"$Src\""} if {$curD != $w} { if {$V>1} {puts "$id: Changing w={$w} to curD={$curD}"} set w $curD } if {$in(PRE) > 0} { if {$V>4} {puts "$id: PREformatted line."} if {$wantNL($curD) < 1} { if {$V>4} {puts "$id: $curD insert end newline (PREformatted line)"} $curD insert end \n set wantNL($curD) 0; # Note that we've inserted the newline. set LC "\n" } } else { HSP $curD $space } if {!$in(H)} { if [regexp -nocase {^} $Src] { if {$V>4} {puts "$id: Found tag"} set in(H) 1 } elseif [regexp -nocase {^