From 620b00948a23a2ea04f4e452a1681508a6f1c783 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sun, 11 Apr 2021 22:26:16 -0400 Subject: Simplify rfctags I wasn't thinking perl enough. --- doc/rfc/rfctags.pl | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/doc/rfc/rfctags.pl b/doc/rfc/rfctags.pl index 45e74f9a..05173d00 100644 --- a/doc/rfc/rfctags.pl +++ b/doc/rfc/rfctags.pl @@ -4,22 +4,18 @@ use warnings; use open ':encoding(ISO-8859-1)'; ($,, $\) = ("\t", "\n"); -for my $rfc (@ARGV) { - open my $handle, '<', $rfc or die "${rfc}: $!"; - while (<$handle>) { - chomp; - # Section headings - if (/^([\d.]+|[A-Z][.])\s+([^\t]+)?/) { - print $1, $rfc, $.; - print $2, $rfc, $. if $2; - print $1, $rfc, $. if $1 =~ /^([\d.]+)[.]$/; - } - # References - if (/^\s*(\[[\w-]+\])\s{2,}/) { - print $1, $rfc, $.; - print "\\$1", $rfc, $.; # vim ^] prepends \ to [ - } +while (<>) { + chomp; + # Section headings + if (/^([\d.]+|[A-Z][.])\s+([^\t]+)?/) { + print $1, $ARGV, $.; + print $2, $ARGV, $. if $2; + print $1, $ARGV, $. if $1 =~ /^([\d.]+)[.]$/; } - die "${rfc}: $!" if $!; - close $handle; + # References + if (/^\s*(\[[\w-]+\])\s{2,}/) { + print $1, $ARGV, $.; + print "\\$1", $ARGV, $.; # vim ^] prepends \ to [ + } + close ARGV if eof; } -- cgit 1.4.1 ommit diff
path: root/bin/cash/libedit/eln.c (unfollow)
Commit message (Expand)Author
2019-02-09Avoid using SGRReset and IRCResetJune McEnroe
2019-02-08Use X macros for hi classesJune McEnroe
2019-02-08Don't open folds when using {}June McEnroe
2019-02-08Add sh syntax to hiJune McEnroe
2019-02-08Use [] to quote special characters in regexJune McEnroe
2019-02-08Improve ANSI output and base IRC on itJune McEnroe
2019-02-08Add hi -nJune McEnroe
2019-02-08Elaborate hi man pageJune McEnroe
2019-02-08Use set for parent in hiJune McEnroe
2019-02-08Switch back to semantic keyword grouping in hiJune McEnroe
2019-02-08Match only the basename in hiJune McEnroe
2019-02-07Add mdoc syntax to hiJune McEnroe
2019-02-07Support multi-line C macros in hiJune McEnroe
2019-02-07Detect .mk files as makeJune McEnroe
2019-02-07Add make syntax to hiJune McEnroe
2019-02-07Add IRC output to hiJune McEnroe
2019-02-07Improve C syntax accuracy and add Format classJune McEnroe
2019-02-07Factor out hi checkJune McEnroe
2019-02-07Add Escape class to hiJune McEnroe
2019-02-07Add Todo class and parent syntax constraintJune McEnroe