aboutsummaryrefslogtreecommitdiffstats
path: root/docs/buildsignals.pl
diff options
context:
space:
mode:
authorTom Feist <shabble@cowu.be>2010-07-12 20:13:36 +0000
committerTom Feist <shabble@cowu.be>2010-07-12 20:13:36 +0000
commitb0ae07d0e1a750afabce530d23288212ca1fd5b6 (patch)
treec0905e3ac6b4cb2dbe5fb4caaa2abb10bca8f666 /docs/buildsignals.pl
parentmore reformattingm, added a guide.pm for general stuff (diff)
downloadirssi-scripts-b0ae07d0e1a750afabce530d23288212ca1fd5b6.tar.gz
irssi-scripts-b0ae07d0e1a750afabce530d23288212ca1fd5b6.zip
started marking up signals for auto-generation
Diffstat (limited to '')
-rwxr-xr-xdocs/buildsignals.pl56
1 files changed, 56 insertions, 0 deletions
diff --git a/docs/buildsignals.pl b/docs/buildsignals.pl
new file mode 100755
index 0000000..11cd74a
--- /dev/null
+++ b/docs/buildsignals.pl
@@ -0,0 +1,56 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+
+use Data::Dumper;
+
+package Pod::Simple::IrssiSignalParser;
+
+use base qw/Pod::Simple::PullParser/;
+
+use Data::Dumper;
+
+sub run {
+ my $self = shift;
+
+ my ($seen_start, $seen_end) = (0,0);
+ my $text_token;
+
+ Token:
+
+ while(my $token = $self->get_token()) {
+ #print "PRocessing token: $token\n";
+
+ if (!$seen_start && $token->is_start) {
+ if ($token->tag eq 'Data') {
+ print "Start Data token: $token\n";
+
+ $text_token = $self->get_token;
+
+ if ($text_token->is_text && $text_token->text =~ /START/) {
+ print "Found start!\n\n";
+ $seen_start = 1;
+ }
+ }
+ }
+ }
+}
+
+package main;
+
+my $input_file = $ARGV[0] // 'Signals.pm';
+my $parser = Pod::Simple::IrssiSignalParser->new;
+
+$parser->accept_targets('irssi_signal_defs', 'irssi_signal_types');
+my $tree = $parser->parse_file($input_file);
+
+
+# if ($type eq 'Data' && $text =~ /START OF SIGNAL DEFINITIONS/) {
+# $seen_start = 1;
+# }
+
+# if ($type eq 'Data' && $text =~ /END OF SIGNAL DEFINITIONS/) {
+# $seen_end = 1;
+# }
+