From ae533ef7247ad8c17c338c8fd77ef90bf169e285 Mon Sep 17 00:00:00 2001 From: fukachan Date: Sun, 13 Jan 2002 22:06:34 +0000 Subject: fundamental diagnostics for code --- regress/simulation/stylecheck | 53 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100755 regress/simulation/stylecheck diff --git a/regress/simulation/stylecheck b/regress/simulation/stylecheck new file mode 100755 index 00000000..a86d762f --- /dev/null +++ b/regress/simulation/stylecheck @@ -0,0 +1,53 @@ +#!/usr/bin/env perl +# +# $FML$ +# + +use strict; +use Carp; + +my $in_perldoc = 0; +my $package = ''; +my $fn = ''; +my $PrevARGV = ''; +my $num_file = 0; + +while (<>) { + next if /^\#/; + + if ($ARGV ne $PrevARGV) { + $in_perldoc = 0; + $package = ''; + $fn = ''; + $PrevARGV = $ARGV; + $num_file++; + print STDERR "reset $num_file $ARGV\n" if $ENV{'debug'}; + } + + $in_perldoc = 1 if /^=/; + + if (/^package (\S+);/) { + $package = $1; + next; + } + + if (/^=cut/) { + $in_perldoc = 0; + next; + } + + if (/^sub (\S+)/) { + $fn = $1; + + if ($in_perldoc) { + print STDERR "${package}::$fn is in document ???\n"; + } + else { + print STDERR "${package}::$fn is ok\n" if $ENV{'debug'}; + } + } + + if (/^1\;\s*$/ && $in_perldoc) { + print STDERR "${package} ends in document ???\n"; + } +} -- cgit v1.2.1