aboutsummaryrefslogtreecommitdiff
path: root/showtodo
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-08-07 22:22:38 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-08-07 22:22:38 +0200
commitd3cd6a63a0fff7cc77f26b319d61ba256aae680c (patch)
treef030663ee7085aa5609a64c5ec9ea2faa9be6aaa /showtodo
parente2d0b92ffc536c3d34ee751ba688946613bc5693 (diff)
downloadEpisodeBrowser-d3cd6a63a0fff7cc77f26b319d61ba256aae680c.tar.gz
Add showtodo script.
Diffstat (limited to 'showtodo')
-rw-r--r--showtodo27
1 files changed, 27 insertions, 0 deletions
diff --git a/showtodo b/showtodo
new file mode 100644
index 0000000..475e492
--- /dev/null
+++ b/showtodo
@@ -0,0 +1,27 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+
+# Note that this script only supports /* C-style */ comments.
+
+while (my $f = glob("c/*.*")) {
+ open my $fh, "<", $f;
+ my $line;
+ while (<$fh>) {
+ $line++;
+ next if not m{TODO:}; # Skip fast.
+
+ next if not m{^\s*/?\*.*\s(TODO:.*)\s*(\*/)?};
+ print "$f:$line: $1\n";
+ next if $2;
+
+ # Continue text if comment is not finished.
+ my $pad = " " x length("$f:$line: ");
+ while (<$fh>) {
+ (my $text = $_) =~ s{^\s*\*?\s*|\s*\*/}{}g;
+ print "$pad$text";
+ last if m{\*/};
+ }
+ }
+}