File: tcltags

package info (click to toggle)
tclreadline 2.3.8-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 1,848 kB
  • sloc: tcl: 5,697; sh: 4,217; ansic: 720; makefile: 80
file content (43 lines) | stat: -rwxr-xr-x 1,037 bytes parent folder | download
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
#!/usr/local/bin/tclsh
# FILE: aux/tcltags
# $Id: 2291b5a1b3eae1d5aabfa40482ebcc763f3d4094 $
# ---
# tclreadline -- gnu readline for tcl
# https://github.com/flightaware/tclreadline/
# Copyright (c) 1998 - 2014, Johannes Zellner <johannes@zellner.org>
# This software is copyright under the BSD license.
# ---

set tags [open "tags" a+]
#set tags stdout
#_BoxHandle Z_Box.c /^int _BoxHandle (Box *boxPtr, Tcl_Interp *interp, int argc, char **argv)$/;"   f

foreach file "$argv" {

    if {[file exists $file]} {

        set source [open $file r]
        if {$source == 0} {
            continue
        }

        while {"[gets $source line]" != -1} {
            if [regexp \
                "^\(proc|class|body|configbody\)\[ \t\]*\(\[^ \t\]*\)\[ \t\]"\
                "$line" all junk proc] {

                set tail [namespace tail $proc]
                puts $tags "$proc\t$file\t/^$line$/;\"\tf"
                puts $tags "$tail\t$file\t/^$line$/;\"\tf"
            }
        }

        close $source

    }

}

close $tags