summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am3
-rwxr-xr-xfindsyntax.pl18
-rwxr-xr-xsyntax.pl33
3 files changed, 29 insertions, 25 deletions
diff --git a/Makefile.am b/Makefile.am
index 7cd7e705..0fb81386 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -30,5 +30,4 @@ EXTRA_DIST = \
$(theme_DATA) \
irssi-config.in \
irssi-icon.png \
- syntax.pl \
- findsyntax.pl
+ syntax.pl
diff --git a/findsyntax.pl b/findsyntax.pl
deleted file mode 100755
index e24d50f0..00000000
--- a/findsyntax.pl
+++ /dev/null
@@ -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;
- }
-}
diff --git a/syntax.pl b/syntax.pl
index f0ec779b..bf10451f 100755
--- a/syntax.pl
+++ b/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";