Hex Artifact Content
Not logged in

Artifact 3390267426aafa4615b30ba4b2ee8e0a7a0c07d3:


0000: 23 21 2f 75 73 72 2f 6c 6f 63 61 6c 2f 62 69 6e  #!/usr/local/bin
0010: 2f 74 63 6c 73 68 0a 23 20 3d 3d 3d 3d 3d 3d 3d  /tclsh.# =======
0020: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0030: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0040: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0050: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0a 23 20 46 49  ===========.# FI
0060: 4c 45 3a 20 61 75 78 2f 76 69 6d 74 61 67 73 0a  LE: aux/vimtags.
0070: 23 20 24 49 64 24 0a 23 20 2d 2d 2d 0a 23 20 74  # $Id$.# ---.# t
0080: 63 6c 72 65 61 64 6c 69 6e 65 20 2d 2d 20 67 6e  clreadline -- gn
0090: 75 20 72 65 61 64 6c 69 6e 65 20 66 6f 72 20 74  u readline for t
00a0: 63 6c 0a 23 20 68 74 74 70 3a 2f 2f 77 77 77 2e  cl.# http://www.
00b0: 7a 65 6c 6c 6e 65 72 2e 6f 72 67 2f 74 63 6c 72  zellner.org/tclr
00c0: 65 61 64 6c 69 6e 65 2f 0a 23 20 43 6f 70 79 72  eadline/.# Copyr
00d0: 69 67 68 74 20 28 63 29 20 31 39 39 38 20 2d 20  ight (c) 1998 - 
00e0: 32 30 31 34 2c 20 4a 6f 68 61 6e 6e 65 73 20 5a  2014, Johannes Z
00f0: 65 6c 6c 6e 65 72 20 3c 6a 6f 68 61 6e 6e 65 73  ellner <johannes
0100: 40 7a 65 6c 6c 6e 65 72 2e 6f 72 67 3e 0a 23 20  @zellner.org>.# 
0110: 54 68 69 73 20 73 6f 66 74 77 61 72 65 20 69 73  This software is
0120: 20 63 6f 70 79 72 69 67 68 74 20 75 6e 64 65 72   copyright under
0130: 20 74 68 65 20 42 53 44 20 6c 69 63 65 6e 73 65   the BSD license
0140: 2e 0a 23 20 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ..# ============
0150: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0160: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0170: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0180: 3d 3d 3d 3d 3d 3d 0a 0a 0a 69 66 20 5b 66 69 6c  ======...if [fil
0190: 65 20 72 65 61 64 61 62 6c 65 20 74 61 67 73 5d  e readable tags]
01a0: 20 7b 0a 20 20 20 20 73 65 74 20 74 61 67 73 20   {.    set tags 
01b0: 5b 6f 70 65 6e 20 74 61 67 73 20 72 5d 0a 20 20  [open tags r].  
01c0: 20 20 73 65 74 20 76 69 6d 20 5b 6f 70 65 6e 20    set vim [open 
01d0: 74 61 67 73 2e 76 69 6d 20 77 5d 0a 20 20 20 20  tags.vim w].    
01e0: 77 68 69 6c 65 20 7b 5b 67 65 74 73 20 24 74 61  while {[gets $ta
01f0: 67 73 20 6c 69 6e 65 5d 20 21 3d 20 2d 31 7d 20  gs line] != -1} 
0200: 7b 0a 20 20 20 20 20 20 20 20 69 66 20 5b 72 65  {.        if [re
0210: 67 65 78 70 20 22 5e 5c 28 5c 5b 5e 20 20 21 5c  gexp "^\(\[^  !\
0220: 5d 2a 5c 29 5c 5b 20 20 20 20 5c 5d 22 20 24 6c  ]*\)\[    \]" $l
0230: 69 6e 65 20 61 6c 6c 20 70 72 6f 63 5d 20 7b 0a  ine all proc] {.
0240: 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 20              set 
0250: 70 72 6f 63 20 5b 73 74 72 69 6e 67 20 74 72 69  proc [string tri
0260: 6d 20 24 70 72 6f 63 5d 0a 20 20 20 20 20 20 20  m $proc].       
0270: 20 20 20 20 20 69 66 20 7b 24 70 72 6f 63 20 21       if {$proc !
0280: 3d 20 22 22 7d 20 7b 0a 20 20 20 20 20 20 20 20  = ""} {.        
0290: 20 20 20 20 20 20 20 20 70 75 74 73 20 24 76 69          puts $vi
02a0: 6d 20 22 73 79 6e 74 61 78 20 6b 65 79 77 6f 72  m "syntax keywor
02b0: 64 20 54 61 67 20 24 70 72 6f 63 22 0a 20 20 20  d Tag $proc".   
02c0: 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20           }.     
02d0: 20 20 20 7d 0a 20 20 20 20 7d 0a 20 20 20 20 63     }.    }.    c
02e0: 6c 6f 73 65 20 24 74 61 67 73 0a 20 20 20 20 63  lose $tags.    c
02f0: 6c 6f 73 65 20 24 76 69 6d 0a 7d 0a 0a           lose $vim.}..