Check-in [5dc4de14de]
Overview
Comment:Allow the user to specify a different output command for minirivet
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 5dc4de14def637e40eff75d8a8ac2a7bb9e4309b131ba889f81bd3e217949313
User & Date: rkeene on 2019-09-20 15:46:05.220
Other Links: manifest | tags
Context
2019-09-20
15:58
Allow the user to specify either the path to or the contents of "xvfs-core.h" check-in: 09e53d3c38 user: rkeene tags: trunk
15:46
Allow the user to specify a different output command for minirivet check-in: 5dc4de14de user: rkeene tags: trunk
15:36
A bit of checks before defining types check-in: c57d8bead8 user: rkeene tags: trunk
Changes
22
23
24
25
26
27
28
29





30
31
32
33
34
35
36
37

38
39
40
41
42
43
44
45
46
47

48
49
50
51
52
53
54
22
23
24
25
26
27
28

29
30
31
32
33
34
35
36
37
38
39
40

41
42
43
44
45
46
47
48
49
50

51
52
53
54
55
56
57
58







-
+
+
+
+
+







-
+









-
+







	}
	if {[info exists ::minirivet::_outputVariable]} {
		append $::minirivet::_outputVariable $string
	}
	return
}

proc ::minirivet::parseStringToCode {string} {
proc ::minirivet::parseStringToCode {string {outputCommand ""}} {
	if {$outputCommand eq ""} {
		set outputCommand [list ::minirivet::_emitOutput]
	}

	set code ""
	while {$string ne ""} {
		set endIndex [string first "<?" $string]
		if {$endIndex == -1} {
			set endIndex [expr {[string length $string] + 1}]
		}

		append code [list ::minirivet::_emitOutput [string range $string 0 $endIndex-1]] "; "
		append code [list {*}$outputCommand [string range $string 0 $endIndex-1]] "; "
		set string [string range $string $endIndex end]
		set endIndex [string first "?>" $string]
		if {$endIndex == -1} {
			set endIndex [expr {[string length $string] + 1}]
		}

		set work [string range $string 0 2]
		if {$work eq "<?="} {
			set startIndex 3
			append code "::minirivet::_emitOutput [string trim [string range $string 3 $endIndex-1]]; "
			append code "$outputCommand [string trim [string range $string 3 $endIndex-1]]; "
		} else {
			append code [string range $string 2 $endIndex-1] "\n"
		}

		set string [string range $string $endIndex+2 end]