Eskil

Check-in [f705f9fd7c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:*** empty log message ***
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f705f9fd7c5e0442e1cdbba15686f5375302e9ed
User & Date: peter 2004-02-23 21:11:46.000
Context
2004-03-30
14:01
Replaced != with ne in a lot of places. Reworked compareBlocks to use lists of lists instead of array as matrix. Added flags to enscript to make sure print behaves the same on different enscript versions. check-in: e807edee25 user: peter tags: trunk
2004-02-23
21:11
*** empty log message *** check-in: f705f9fd7c user: peter tags: trunk
21:10
First testsuite. check-in: 89eb5ba442 user: peter tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Added instrument.tcl.


















































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
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
#!/bin/sh
#----------------------------------------------------------------------
# A simple instrumenter for code coverage
#----------------------------------------------------------------------
# $Revision$
#----------------------------------------------------------------------
# the next line restarts using tclsh \
exec tclsh "$0" "$@"

set ch [open eskil.tcl r]
set cho [open eskili.tcl w]
if {$argc == 0} {
    set instrument 1
    set endRE ""
} else {
    set instrument 0
    set startRE "proc (?:[join $argv |])"
    set endRE "^\}\\s*$"
}
set commRE "^\\s*\#"
# Missing: switch branches
set iRE {(?:if|elseif|else|while|for|foreach) .*\{\s*$}
set lineNo 0
set prev ""
while {[gets $ch line] >= 0} {
    incr lineNo
    if {$prev ne ""} {
        set line $prev\n$line
        set prev ""
    }
    if {[string index $line end] eq "\\"} {
        set prev $line
        continue
    }
    if {$instrument} {
        if {$endRE ne "" && [regexp $endRE $line]} {
            set instrument 0
            puts $cho $line
            continue
        }
        if {![regexp $commRE $line]&& [regexp $iRE $line]} {
            append line " [list set ::_instrument($lineNo) 1]"
            set ::_instrument($lineNo) 1
        }
    } else {
        if {[regexp $startRE $line]} {
            set instrument 1
        }
    }
    puts $cho $line
}
close $cho
close $ch

set ch [open _instrument_lines w]
puts $ch [join [lsort -integer [array names ::_instrument]] \n]
close $ch