diff options
author | Emanuele Giaquinta <exg@irssi.org> | 2008-11-13 10:22:35 +0000 |
---|---|---|
committer | exg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2008-11-13 10:22:35 +0000 |
commit | 5497b07c8a1331e0322b614f55d458d2319ea3ea (patch) | |
tree | 3180cf4588e155e97955fa47205d1132bf254ddd /syntax.pl | |
parent | 169c55b9496aaa8517f18f9f288b9fdf759040df (diff) | |
download | irssi-5497b07c8a1331e0322b614f55d458d2319ea3ea.zip |
Merge findsyntax.pl in syntax.pl.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4905 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'syntax.pl')
-rwxr-xr-x | syntax.pl | 33 |
1 files changed, 28 insertions, 5 deletions
@@ -10,8 +10,33 @@ # Remember to include the asterisk ('*'). $SRC_PATH='src'; -$FOO = `find src -name '*.c' -exec perl findsyntax.pl \{\} \\; | sed 's/.*SYNTAX: //' > irssi_syntax`; +@files = `find src -name '*.c'`; +foreach $file (@files) { + open (FILE, "$file"); + while (<FILE>) { + chomp; + if (m!/\*.SYNTAX\:! || $state) { + s/^\s+/ /; + s/.*SYNTAX: //; + if (/^ [A-Z]+/) { + push @lines, $line; + $line = ""; + s/^ //; + } + $line .= $_; + if (m!\*/!) { + $line =~ s!\*/!!; + push @lines, $line; + $line = ""; + $state = 0; + } else { + $state = 1; + } + } + } + close (FILE); +} while (<docs/help/in/*.in>) { next if (/Makefile/); @@ -21,9 +46,8 @@ while (<docs/help/in/*.in>) { $count = 0; foreach $DATARIVI (@data) { if ($DATARIVI =~ /\@SYNTAX\:(.+)\@/) { - $etsittava = "\U$1 "; - $SYNTAX = `grep \'^$etsittava\' irssi_syntax`; - $SYNTAX =~ s/\*\///g; + $SYNTAX = join "\n", (grep /^\U$1 /, @lines); + $SYNTAX .= "\n" if $SYNTAX; $SYNTAX =~ s/ *$//; $SYNTAX =~ s/ *\n/\n/g; # add %| after "COMMAND SUB " so parameters will indent correctly @@ -54,4 +78,3 @@ while (<docs/help/in/*.in>) { print NEWFILE @data; close (NEWFILE); } -unlink "irssi_syntax"; |