diff options
author | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-11-22 16:03:14 +0800 |
---|---|---|
committer | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-11-22 16:03:14 +0800 |
commit | 466da544fda3aa6ed86480162b607e1a2ae6ec55 (patch) | |
tree | d672bba9618f0a4b51b137a34e2595a3772705d3 /docs/proto | |
parent | 4f9a777998858d0aea9ccb5daf390a54fece4923 (diff) | |
download | pttbbs-466da544fda3aa6ed86480162b607e1a2ae6ec55.tar pttbbs-466da544fda3aa6ed86480162b607e1a2ae6ec55.tar.gz pttbbs-466da544fda3aa6ed86480162b607e1a2ae6ec55.tar.bz2 pttbbs-466da544fda3aa6ed86480162b607e1a2ae6ec55.tar.lz pttbbs-466da544fda3aa6ed86480162b607e1a2ae6ec55.tar.xz pttbbs-466da544fda3aa6ed86480162b607e1a2ae6ec55.tar.zst pttbbs-466da544fda3aa6ed86480162b607e1a2ae6ec55.zip |
fix assess bug
some comments
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2348 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'docs/proto')
-rwxr-xr-x | docs/proto/cdoc | 14 |
1 files changed, 12 insertions, 2 deletions
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 "",<SRC>; 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"; } |