1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Merge findsyntax.pl in syntax.pl.

git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4905 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Emanuele Giaquinta 2008-11-13 10:22:35 +00:00 committed by exg
parent 169c55b949
commit 5497b07c8a
3 changed files with 29 additions and 25 deletions

View File

@ -30,5 +30,4 @@ EXTRA_DIST = \
$(theme_DATA) \
irssi-config.in \
irssi-icon.png \
syntax.pl \
findsyntax.pl
syntax.pl

View File

@ -1,18 +0,0 @@
#!/usr/bin/perl -w
while(<>) {
if(m!/\*.SYNTAX\:! || $tt) {
s/^\s+/ /;
if (/^ [A-Z]+/) {
print "\n";
s/^ //;
}
if (m!\*/!) {
$tt=0;
} else {
$tt=1;
chomp;
}
print;
}
}

View File

@ -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";