Annotation For lib/minirivet/minirivet.tcl

Lines of lib/minirivet/minirivet.tcl from check-in 9b0190676f that are changed by the sequence of edits moving toward check-in b07616bee9:

                         1: #! /usr/bin/env tclsh
                         2: 
                         3: namespace eval ::minirivet {}
                         4: 
                         5: proc ::minirivet::parseStringToCode {string} {
                         6: 	set code ""
                         7: 	while {$string ne ""} {
                         8: 		set endIndex [string first "<?" $string]
                         9: 		if {$endIndex == -1} {
                        10: 			set endIndex [expr {[string length $string] + 1}]
                        11: 		}
                        12: 
9b0190676f 2019-05-22   13: 		append code [list puts -nonewline [string range $string 0 $endIndex-1]] "; "
                        14: 		set string [string range $string $endIndex end]
                        15: 		set endIndex [string first "?>" $string]
                        16: 		if {$endIndex == -1} {
                        17: 			set endIndex [expr {[string length $string] + 1}]
                        18: 		}
                        19: 
                        20: 		set work [string range $string 0 2]
                        21: 		if {$work eq "<?="} {
                        22: 			set startIndex 3
9b0190676f 2019-05-22   23: 			append code "puts -nonewline [string trim [string range $string 3 $endIndex-1]]; "
                        24: 		} else {
                        25: 			append code [string range $string 2 $endIndex-1] "\n"
                        26: 		}
                        27: 
                        28: 		set string [string range $string $endIndex+2 end]
                        29: 
                        30: 
                        31: 	}
                        32: 
                        33: 	return $code
                        34: }
                        35: 
                        36: proc ::minirivet::parseString {string} {
                        37: 	set code [parseStringToCode $string]
                        38: 	tailcall namespace eval ::request $code
                        39: }
                        40: 
                        41: proc ::minirivet::parse {file} {
                        42: 	set fd [open $file]
                        43: 	set data [read $fd]
                        44: 	close $fd
                        45: 	tailcall parseString $data
                        46: }
                        47: 
                        48: package provide minirivet 1