-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathtcltags
executable file
·43 lines (31 loc) · 994 Bytes
/
tcltags
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
#!/usr/local/bin/tclsh
# FILE: aux/tcltags
# $Id$
# ---
# tclreadline -- gnu readline for tcl
# https://github.com/flightaware/tclreadline/
# Copyright (c) 1998 - 2014, Johannes Zellner <[email protected]>
# 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