From 466da544fda3aa6ed86480162b607e1a2ae6ec55 Mon Sep 17 00:00:00 2001 From: victor Date: Mon, 22 Nov 2004 08:03:14 +0000 Subject: fix assess bug some comments git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2348 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- docs/proto/cdoc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/proto/cdoc b/docs/proto/cdoc index e9403589..d21fa988 100755 --- a/docs/proto/cdoc +++ b/docs/proto/cdoc @@ -50,6 +50,8 @@ sub grep_desc my $param = "(?:$one_param(?:$more_param)*)?"; my $func_proto = "(?:$modifier)?$type\\s+$name\\($param\\)"; + $content =~ s/($desc_head(?:$desc_line)*\s*\*\*\/)//mo and return "$1\n"; + $content =~ s/($desc_head(?:$desc_line)*$desc_tail)?($func_proto)\s*{//mo or return undef; my $comment = $1; @@ -57,9 +59,15 @@ sub grep_desc $function =~ s/\n/ /g; $function =~ s/\s+/ /g; + if ($comment) { + $comment =~ s#^/\*\*##; + $comment =~ s#\s*\*/$##; + $comment =~ s/^\s*\*/ /mg; + } + # check comment style here - return "$function;\n".($comment ? $comment : "/* no comment */\n"); + return "$function;\n".($comment ? $comment : " no comment\n"); } sub makedoc @@ -68,7 +76,9 @@ sub makedoc open SRC, "<$_"; $content = join "",; close SRC; - print "/* vim:ft=c */\n\n"; + + # just to break them up to avoid vim's misunderstanding + print "// vim".":ft=c\n\n"; while ($_ = grep_desc()) { print "$_\n"; } -- cgit v1.2.3