ASF Bugzilla – Attachment 21563 Details for
Bug 44453
list_hooks.pl doesn't parse declarations that span multiple lines
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
this new script cures the problem
xxx (text/plain), 2.48 KB, created by
Torsten F
on 2008-02-19 06:48:10 UTC
(
hide
)
Description:
this new script cures the problem
Filename:
MIME Type:
Creator:
Torsten F
Created:
2008-02-19 06:48:10 UTC
Size:
2.48 KB
patch
obsolete
>--- - 2008-02-19 15:46:58.789290304 +0100 >+++ support/list_hooks.pl 2008-02-19 15:27:24.000000000 +0100 >@@ -1,4 +1,5 @@ > #!/usr/bin/perl -w >+# -*- mode:cperl;cperl-indent-level:4;cperl-continued-statement-offset:4;indent-tabs-mode:nil -*- > # > # Licensed to the Apache Software Foundation (ASF) under one or more > # contributor license agreements. See the NOTICE file distributed with >@@ -36,6 +37,8 @@ > print "\n"; > } > >+#warn "found ".keys(%::Hooks)." hooks\n"; >+ > sub findInDir { > my $path=shift; > >@@ -65,32 +68,31 @@ > while(<F>) { > next if /\#define/; > next if /\@deffunc/; >- if(/AP_DECLARE_HOOK\((.*)\)/) { >- my $def=$1; >- my($ret,$name,$args)=$def=~/([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*\((.*)\)/; >- croak "Don't understand $def in $file" if !defined $args; >-# print "found $ret $name($args) in $file\n"; >- >- croak "$name declared twice! ($_)" >- if exists $::Hooks{$name}->{declared}; >- $::Hooks{$name}->{declared}=$file; >- $::Hooks{$name}->{ret}=$ret; >- $::Hooks{$name}->{args}=$args; >- } elsif(/AP_DECLARE_HOOK\((\s*[^,\s]+)\s*,\s*([^,\s]+)/) { >-# really we should swallow subsequent lines to get the arguments... >- my $name=$2; >- my $ret=$1; >- croak "$name declared twice! ($_)" >- if exists $::Hooks{$name}->{declared}; >- $::Hooks{$name}->{declared}=$file; >- $::Hooks{$name}->{ret}=$ret; >- $::Hooks{$name}->{args}='???'; >+ if(/AP_DECLARE_HOOK\s*\(/) { >+ my($ret,$name,$args); >+ while(!(($ret,$name,$args)= >+ /AP_DECLARE_HOOK\s*\(\s*([^,]+)\s*,\s*([^,\s]+)\s*,\s*\((.*?)\)\)/s)) { >+ chomp; >+ my $l=<F>; >+ return unless defined $l; >+ $l=~s/^\s*/ /; >+ $_.=$l; >+ } >+ $ret=~s/\s*$//; >+ $args=~s/^\s*//; $args=~s/\s*$//; >+# warn "found $ret $name($args) in $file\n"; >+ >+ croak "$name declared twice! ($_)" >+ if exists $::Hooks{$name}->{declared}; >+ $::Hooks{$name}->{declared}=$file; >+ $::Hooks{$name}->{ret}=$ret; >+ $::Hooks{$name}->{args}=$args; > } > if(/AP_IMPLEMENT_HOOK_()(VOID)\(([^,\s]+)/ > || /AP_IMPLEMENT(_OPTIONAL|)_HOOK_(.*?)\([^,]+?\s*,\s*([^,\s]+)/) { > my($type,$name)=($1 ? "OPTIONAL $2" : $2,$3); > >-# print "found $name $type in $file\n"; >+# warn "found $name $type in $file\n"; > > croak "$name implemented twice ($::Hooks{$name}->{implemented} and $file) ($_)" > if exists $::Hooks{$name}->{implemented};
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 44453
: 21563