Check-in [9b0190676f]
Overview
Comment:Improved minirivet to use lists
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 9b0190676f109736984460d766f4f5e18ae2e9c03e2d3cb899156776fe9996f9
User & Date: rkeene on 2019-05-22 14:28:12
Other Links: manifest | tags
Context
2019-06-22
22:15
Additional cleanup check-in: aa32555a0a user: rkeene tags: trunk
2019-05-22
14:28
Improved minirivet to use lists check-in: 9b0190676f user: rkeene tags: trunk
2019-05-08
19:42
In flexible/standalone mode include the core functionality as a header to avoid duplicate symbols check-in: b8cca3a6b4 user: rkeene tags: trunk
Changes

Modified lib/minirivet/minirivet.tcl from [4c17a6eef0] to [0d1a3257b6].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

20
21
22
23
24
25
26
1
2
3
4
5





6
7
8
9
10
11
12


13
14
15
16
17
18
19
20





-
-
-
-
-







-
-
+







#! /usr/bin/env tclsh

namespace eval ::minirivet {}

proc ::minirivet::parseStringToCode {string} {
	set fixMap [list]
	foreach char [list "\{" "\}" "\\"] {
		lappend fixMap $char "\}; puts -nonewline \"\\$char\"; puts -nonewline \{"
	}

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


		append code "puts -nonewline \{" [string map $fixMap [string range $string 0 $endIndex-1]] "\}; "
		append code [list puts -nonewline [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]