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:
parent
169c55b949
commit
5497b07c8a
@ -30,5 +30,4 @@ EXTRA_DIST = \
|
||||
$(theme_DATA) \
|
||||
irssi-config.in \
|
||||
irssi-icon.png \
|
||||
syntax.pl \
|
||||
findsyntax.pl
|
||||
syntax.pl
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
33
syntax.pl
33
syntax.pl
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user