From 15525498b71bf7fa4bf1562c8942eaad1d2fc067 Mon Sep 17 00:00:00 2001 From: wolf Date: Mon, 3 Feb 2003 16:55:20 +0000 Subject: [PATCH] Fix bug: namespaces can end in } without a semicolon. Elements after such a closing brace were spuriously added to that namespace before. git-svn-id: https://svn.dealii.org/trunk@7006 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/contrib/kdoc/src/kdoc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/deal.II/contrib/kdoc/src/kdoc b/deal.II/contrib/kdoc/src/kdoc index 114c873ce5..c94dbf493f 100755 --- a/deal.II/contrib/kdoc/src/kdoc +++ b/deal.II/contrib/kdoc/src/kdoc @@ -600,7 +600,7 @@ sub identifyDecl $newNode = newFriendClass ($2, $1); } - # Class/Struct + # Class/Struct/Namespace elsif ( $decl =~ /^\s*((?:template\s*<.*>)?) # 1 template \s*(class|struct|union|namespace) # 2 struct type \s+([\w_]+ # 3 name @@ -774,9 +774,17 @@ sub identifyDecl $skipBlock = 1 if $end eq '{'; } - # end of an "extern" block + # end of an "extern" or namespace block elsif ( $decl =~ /^\s*}\s*$/ ) { - $inExtern = 0; + if ( ! ($#classStack < 0 )) { + $cNode = pop @classStack; + + print "end decl: popped $cNode->{astNodeName}\n" + if $debug; + } + else { + $inExtern = 0; + } } # end of an in-block declaration elsif ( $decl =~ /^\s*}\s*(.*?)\s*;\s*$/ ) { -- 2.39.5