Only in headerdoc-8.8.38-patched: HeaderDoc-1.3-strict.dtd Only in headerdoc-8.8.38-patched: HeaderDoc-1.3.dtd diff -ru headerdoc-8.8.38/Modules/HeaderDoc/APIOwner.pm headerdoc-8.8.38-patched/Modules/HeaderDoc/APIOwner.pm --- headerdoc-8.8.38/Modules/HeaderDoc/APIOwner.pm 2011-05-19 16:40:59.000000000 -0700 +++ headerdoc-8.8.38-patched/Modules/HeaderDoc/APIOwner.pm 2011-12-03 15:50:36.000000000 -0800 @@ -3,7 +3,7 @@ # Class name: APIOwner # Synopsis: Abstract superclass for Header and OO structures # -# Last Updated: $Date: 2011/05/18 12:09:34 $ +# Last Updated: $Date: 2011/05/26 16:14:13 $ # # Method additions by SKoT McDonald Aug 2001 # @@ -74,6 +74,11 @@ # Contains an array of names of functions to "also include" in # the documentation for this class/pseudoclass. Mainly intended # for applying class-like behavior to procedural languages. +# @var APPLEREFUSED +# A reference to a hash containing API references that have been +# emitted already in the context of this API owner. This is +# needed so that it can be reset if a class is re-emitted (after +# category folding, for example). # @var CATEGORIES # An array of # {@link //apple_ref/perl/cl/HeaderDoc::ObjCCategory ObjCCategory} @@ -225,7 +230,7 @@ # In the git repository, contains the number of seconds since # January 1, 1970. # */ -$HeaderDoc::APIOwner::VERSION = '$Revision: 1305745774 $'; +$HeaderDoc::APIOwner::VERSION = '$Revision: 1306451653 $'; my $addToDebug = 0; @@ -7579,5 +7584,55 @@ $self->{PDEFINES} = \@newobjs; } + +# /*! +# @abstract +# Marks an API reference ID as having been emitted already. +# @param self +# The API owner object. +# @param uid +# The user ID to query or set. +# @param used +# Normally, you would pass 1 when setting. If you just +# want to query the value, do not pass this argument. +# */ +sub appleRefUsed +{ + my $self = shift; + my $uid = shift; + + my %map = (); + + if ($self->{APPLEREFUSED}) { + %map = %{$self->{APPLEREFUSED}}; + } + + my $retval = $map{$uid}; + + if (@_) { + # print STDERR "SETTING USED FOR $uid ON $self\n"; + $map{$uid} = 1; + $self->{APPLEREFUSED} = \%map; + } + + return $retval; +} + +# /*! +# @abstract +# Clears the API reference hash used by {@link appleRefUsed}. +# @discussion +# This is called when an API owner object needs to be +# emitted again (e.g. when a category's methods are folded +# into a class in another header). +# */ +sub resetAppleRefUsed +{ + my $self = shift; + + # print STDERR "RESETTING USED ON $self\n"; + delete $self->{APPLEREFUSED}; +} + 1; diff -ru headerdoc-8.8.38/Modules/HeaderDoc/BlockParse.pm headerdoc-8.8.38-patched/Modules/HeaderDoc/BlockParse.pm --- headerdoc-8.8.38/Modules/HeaderDoc/BlockParse.pm 2011-05-19 16:40:59.000000000 -0700 +++ headerdoc-8.8.38-patched/Modules/HeaderDoc/BlockParse.pm 2011-12-03 15:53:53.000000000 -0800 @@ -3,7 +3,7 @@ # Module name: BlockParse # Synopsis: Block parser code # -# Last Updated: $Date: 2011/05/19 13:01:25 $ +# Last Updated: $Date: 2011/12/03 10:28:42 $ # # Copyright (c) 1999-2004 Apple Computer, Inc. All rights reserved. # @@ -112,7 +112,7 @@ # In the git repository, contains the number of seconds since # January 1, 1970. # */ -$HeaderDoc::BlockParse::VERSION = '$Revision: 1305835285 $'; +$HeaderDoc::BlockParse::VERSION = '$Revision: 1313085346_patched $'; ################ Portability ################################### my $isMacOS; @@ -571,6 +571,10 @@ # character. (The value of inComment (in the # parserState object) goes to 0 before that code, so # without this, it would end up at the start of the next parameter.) +# @var asConcat +# In AppleScript parsing, set to 1 when a vertical pipe operator (|) is +# encountered to protect an identifier. Set to 0 when the next vertical +# pipe operator is encountered. # # @vargroup Parameter parsing # @@ -616,6 +620,28 @@ # to insert the parser state because it is one of the access control tokens (e.g. # public/private) or because it isn't really being inserted into the tree. # +# @var pushParserStateAfterToken +# Normally 0. Set to 1 if the parser state should be pushed onto the stack +# after this token. +# +# @var pushParserStateAfterWordToken +# Normally 0. Set to 1 if the parser state should be pushed onto the stack +# after the next word token. May also be set to 2 if the parser state +# should be pushed at the word token after the next word token. +# +# @var pushParserStateAtBrace +# Normally 0. Set to 1 if the parser state should be pushed onto the stack +# after the next opening brace. +# +# @var occPushParserStateOnWordTokenAfterNext +# Normally 0. The name of this variable is slightly misleading. When used, +# the variable is initially set to 2. On the next word token (and only a word +# token), this variable is decremented to 1. +# +# At this point, matching behavior changes, and the parser state is pushed +# at the first token that is either a word token, an at sign (@), a +# minus sign (-), or a plus sign (+). +# # @vargroup Tree management # # @var treeTop @@ -639,6 +665,11 @@ # @var treePopOnNewLine # This indicates that the current position in the parse tree should be popped from # the treeStack stack after the next newline character. +# @var trailingHide +# Indicates that this is a token that follows a state change to a new state in which +# the seenBraces flag was previously set, and that this token should be treated as +# though seenBraces were still set. This flag is only supported in bits of code after +# where it is first set (in the right closing brace code). # # @vargroup Parser stacks # @@ -893,7 +924,7 @@ # that don't begin with parenthesis or brace. # my $inBrackets = 0; # square brackets ([]). my $inPType = 0; # in pascal types. - my $inRegexp = 0; # in perl regexp. + my $inRegexp = 0; # in regexp. my $leavingRegexp = 0; # inRegexp just went to zero, but don't process # this symbol differently in case it's a brace # or parenthesis. @@ -911,10 +942,10 @@ # This prevents the end-of-comment character # itself from being added.... - my $regexppattern = ""; # optional characters at start of regexp - my $singleregexppattern = ""; # members of regexppattern that take only - # one argument instead of two. - my $regexpcharpattern = ""; # legal chars to start a regexp. + #### my $regexppattern = ""; # optional characters at start of regexp + #### my $singleregexppattern = ""; # members of regexppattern that take only + #### # one argument instead of two. + #### my $regexpcharpattern = ""; # legal chars to start a regexp. my @regexpStack = (); # stack of RE tokens (since some can nest). # Get the parse tokens from Utilities.pm. @@ -935,6 +966,13 @@ my $requiredregexp = $parseTokens{requiredregexp}; my $moduleregexp = $parseTokens{moduleregexp}; + my $regexppattern = $parseTokens{regexppattern}; + my $singleregexppattern = $parseTokens{singleregexppattern}; + my $regexpfirstcharpattern = $parseTokens{regexpfirstcharpattern}; + my $regexpcharpattern = $parseTokens{regexpcharpattern}; + my $regexpAllowedAfter = $parseTokens{regexpAllowedAfter}; + my $TCLregexpcommand = $parseTokens{TCLregexpcommand}; + # print STDERR "SOCONSTRUCTOR: \"$parseTokens{soconstructor}\"\n"; if ($argparse && $lang eq "applescript") { @@ -960,12 +998,12 @@ # Set up regexp patterns for perl, variable for perl or shell. if ($lang eq "perl" || $lang eq "shell" || $lang eq "tcl") { if ($lang eq "perl") { - # $regexpcharpattern = '\\{|\\#\\(|\\/|\\\'|\\"|\\<|\\[|\\`'; - # "}" vi bug workaround for previous line - $regexpcharpattern = "[[|{#(/'\"<`]"; - # "}" vi bug workaround for previous line - $regexppattern = "qq|qr|qx|qw|q|m|s|tr|y"; - $singleregexppattern = "qq|qr|qx|qw|q|m"; + #### # $regexpcharpattern = '\\{|\\#\\(|\\/|\\\'|\\"|\\<|\\[|\\`'; + #### # "}" vi bug workaround for previous line + #### $regexpcharpattern = "[[|{#(/'\"<`]"; + #### # "}" vi bug workaround for previous line + #### $regexppattern = "qq|qr|qx|qw|q|m|s|tr|y"; + #### $singleregexppattern = "qq|qr|qx|qw|q|m"; } } @@ -1054,6 +1092,7 @@ # my $classtype = ""; # my $inClass = 0; + my $asConcat = ""; my $pushParserStateAfterToken = 0; my $pushParserStateAfterWordToken = 0; my $pushParserStateAtBrace = 0; @@ -1257,10 +1296,10 @@ $noCPPThisToken = 1; } } - if ($inCPPSpecial && $part =~ /(ifdef|ifndef)/) { + if ($inCPPSpecial && $part =~ /^(ifdef|ifndef)$/) { print STDERR "CPPSpecial: ifdef/ifndef\n" if ($cppDebug); $parserState->{NEXTTOKENNOCPP} = 2; - } elsif ($inCPPSpecial && $part =~ /if/) { + } elsif ($inCPPSpecial && $part =~ /^if$/) { print STDERR "CPPSpecial: if\n" if ($cppDebug); $parserState->{NEXTTOKENNOCPP} = 1; } @@ -1577,6 +1616,7 @@ my $hideTokenAndMaybeContents = 0; my $bshandled = 0; my $setIsAvailable = 0; + my $trailingHide = 0; $treeSkip = 0; print STDERR "INMACROLINE: ".$parserState->{inMacroLine}."\n" if ($localDebug || $parseDebug || $parmDebug); @@ -1714,11 +1754,14 @@ print STDERR "PART: posstypes: $parserState->{posstypes}\n"; print STDERR "PART: seenBraces: $parserState->{seenBraces}\n"; print STDERR "SEENIF: ".$parserState->{seenIf}." INIF: ".$parserState->{INIF}."\n"; + } elsif ($parserStateInsertDebug) { + print STDERR "PART: seenBraces: $parserState->{seenBraces}\n"; } if ($parseDebug || $regexpDebug) { print STDERR "PART: inRegexp: $inRegexp inRegexpCharClass: $inRegexpCharClass\n"; print STDERR "PART: inRegexpTrailer: $inRegexpTrailer inRegexpFirstPart: $inRegexpFirstPart\n"; print STDERR "PART: leavingRegexp: $leavingRegexp regexpNoInterpolate: $regexpNoInterpolate\n"; + print STDERR "PART: inTCLRegExpCommand: ".$parserState->{inTCLRegExpCommand}." afterNL: ".$parserState->{afterNL}."\n"; } if ($parseDebug) { print STDERR "PART: seenTilde: $parserState->{seenTilde}\n"; @@ -1955,8 +1998,8 @@ print STDERR "parserState pushed onto stack[PROTOCOL]\n" if ($parserStackDebug); $parserState->{inProtocol} = -1; - $parserState->{lastTreeNode} = $treeCur; print STDERR "Last tree node set to $treeCur [2]\n" if ($parserStateInsertDebug); + $parserState->{lastTreeNode} = $treeCur; $curline = ""; $parserState->{storeDec} = $declaration; $parserState->{freezereturn} = 1; @@ -2214,23 +2257,29 @@ $parserState->dbprint() if ($regexpDebug == 2); print STDERR "LASTNSPART: $lastnspart\n" if ($regexpDebug == 2); - print STDERR " - (($inRegexp || $parserState->{lastsymbol} eq \"~\" || - ((!$inRegexp) && - ($parserState->{lastsymbol} =~ /[=,(]/ || - ($parserState->{lastsymbol} eq \"\" && $lastnspart eq \"\" && peek(\"".peek(\@braceStack)."\") eq \"(\") - ) && $part =~ /\// && !$parserState->{inTemplate} && - length($regexpcharpattern) && - !($inRegexp || $inRegexpTrailer || - $parserState->{inString} || $parserState->{inComment} || - $parserState->{inInlineComment} || $parserState->{inChar}) - ) - ) && - (length($regexpcharpattern) && - $part =~ /^($regexpcharpattern)$/ && - (!$inRegexpCharClass) && - (!scalar(@regexpStack) || $part eq peekmatch(\@regexpStack, $lang, $fullpath, $inputCounter)) - ) + print STDERR "\n + (($inRegexp &&\n + (length($regexpcharpattern) &&\n + $part =~ /^($regexpcharpattern)$/ &&\n + (!$inRegexpCharClass) &&\n + (!scalar(\@regexpStack) || $part eq peekmatch(\\\@regexpStack, $lang, $fullpath, $inputCounter))\n + )\n + ) || (\n + (!$inRegexp) &&\n + ($parserState->{lastsymbol} =~ /$regexpAllowedAfter/ ||\n + $parserState->{inTCLRegExpCommand} ||\n + ($parserState->{lastsymbol} eq \"\" && $lastnspart eq \"(\" && peek(\\\@braceStack) eq \"(\")\n + ) && $part =~ /\// && !$parserState->{inTemplate} &&\n + length($regexpfirstcharpattern) &&\n + (!($inRegexp || $inRegexpTrailer ||\n + $parserState->{inString} || $parserState->{inComment} ||\n + $parserState->{inInlineComment} || $parserState->{inChar})) &&\n + (!$parserState->isRubyOpenQuote($part) || $parserState->isRubyCloseQuote($part)) &&\n + (length($regexpfirstcharpattern) &&\n + $part =~ /^($regexpfirstcharpattern)$/ &&\n + (!$inRegexpCharClass) &&\n + (!scalar(\@regexpStack) || $part eq peekmatch(\\\@regexpStack, $lang, $fullpath, $inputCounter))\n + )\n \n" if ($regexpDebug == 2); if ($HeaderDoc::parseIfElse && (!$parserState->{inMacro} && !$parserState->{inMacroLine} && !($parserState->{inString} || $parserState->{inComment} || $parserState->{inInlineComment} || $parserState->{inChar}))) { @@ -2308,13 +2357,57 @@ $parserState->{variableNameConcat} = 2; }; + + if ($lang eq "tcl") { + if ($part =~ /[\n\r]/) { + # 2 until first non-space token. + $parserState->{afterNL} = 2; + + if ($parserState->{inTCLRegExpCommand}) { + $parserState->{inTCLRegExpCommand} = 0; + } + } elsif ($parserState->{afterNL} == 1) { + # 0 after first non-space token. + $parserState->{afterNL} = 0; + } elsif ($parserState->{afterNL} == 2 && $part =~ /\S/) { + # 1 during first non-space token. + $parserState->{afterNL} = 1; + } + } + + SWITCH: { # Blank declaration handlers (mostly for misuse of # OSMetaClassDeclareReservedUsed and similar) - (($lang eq "applescript") && !$argparse && ($part =~ /(of|in)/) && + (($lang eq "applescript") && !$argparse && ($part eq "|") && !($parserState->{inString} || $parserState->{inComment} || $parserState->{inInlineComment} || $parserState->{inChar})) && do { + print STDERR "APPLESCRIPT CONCAT: CASE AS_00a\n" if ($liteDebug); + if ($asConcat) { + $part = $asConcat . $part; + $asConcat = ""; + # Fall through. + } else { + $asConcat = $part; + $part = ""; + last SWITCH; + } + }; + + (($lang eq "applescript") && !$argparse && ($asConcat) && + !($parserState->{inString} || $parserState->{inComment} || $parserState->{inInlineComment} || + $parserState->{inChar})) && do { + print STDERR "APPLESCRIPT CONCAT: CASE AS_00b\n" if ($liteDebug); + $asConcat .= $part; + $part = ""; + last SWITCH; + }; + + (($lang eq "applescript") && !$argparse && ($part =~ /^(of|in)$/) && + !($parserState->{inString} || $parserState->{inComment} || $parserState->{inInlineComment} || + $parserState->{inChar})) && do { + print STDERR "APPLESCRIPT OF/IN: CASE AS_00A\n" if ($liteDebug); print STDERR "IN APPLESCRIPT OF/IN: SET TO $part\n" if ($asDebug); $parserState->{inOfIn} = 1; $parserState->{OfIn} = $part; @@ -2322,6 +2415,7 @@ }; (($lang eq "applescript") && $parserState->{inOfIn} && ($part =~ /\w/)) && do { + print STDERR "APPLESCRIPT OF/IN: CASE AS_00B\n" if ($liteDebug); print STDERR "IN APPLESCRIPT OF/IN: ADDING $part\n" if ($asDebug); $parserState->{OfIn} .= " ".$part; $parserState->{inOfIn} = 0; @@ -2329,6 +2423,7 @@ }; (($lang eq "applescript") && !$argparse && $labelregexp && ($part =~ /$labelregexp/) && ($parserState->{startOfDec} != 1)) && do { + print STDERR "APPLESCRIPT OF/IN: CASE AS_00C\n" if ($liteDebug); print STDERR "IN APPLESCRIPT LABEL: SET TO $part SOD=".$parserState->{startOfDec}."\n" if ($asDebug); $parserState->{inLabel} = 1; $parserState->{ASlabel} = $part; @@ -2336,6 +2431,7 @@ }; (($lang eq "applescript") && $labelregexp && $parserState->{inLabel} && ($part =~ /\w/)) && do { + print STDERR "APPLESCRIPT OF/IN: CASE AS_00D\n" if ($liteDebug); print STDERR "IN APPLESCRIPT LABEL: ADDING $part\n" if ($asDebug); $parserState->{ASlabel} .= " ".$part; $parserState->{inLabel} = 0; @@ -2343,12 +2439,14 @@ }; (($lang eq "applescript") && ($part eq "given")) && do { + print STDERR "APPLESCRIPT OF/IN: CASE AS_00E\n" if ($liteDebug); print STDERR "IN APPLESCRIPT GIVEN ($part)\n" if ($asDebug); $parserState->{inGiven} = 1; $parserState->{inLabel} = 0; last SWITCH; }; (($lang eq "applescript") && $parserState->{inGiven} && ($part !~ /[\r\n]/)) && do { + print STDERR "APPLESCRIPT OF/IN: CASE AS_00F\n" if ($liteDebug); print STDERR "IN APPLESCRIPT GIVEN\n" if ($asDebug); if ($part eq ",") { print STDERR "IN APPLESCRIPT GIVEN COMMA\n" if ($asDebug); @@ -2363,17 +2461,20 @@ }; # (($lang eq "applescript") && $argparse && ($part eq ":")) && do { + # print STDERR "APPLESCRIPT OF/IN: CASE AS_00G\n" if ($liteDebug); # print STDERR "IN APPLESCRIPT GIVEN: IGNORING COLON\n" if ($asDebug); # $treepart = ""; # last SWITCH; # }; (($iskw == 9) && ($parserState->{afterSemi} || $parserState->{firstpastnl})) && do { + print STDERR "ISKEYWORD == 9: CASE KW_0A\n" if ($liteDebug); $parserState->{inCase}++; print STDERR "inCase -> ".$parserState->{inCase}."\n" if ($parseDebug || $localDebug || $braceDebug); }; (($iskw == 10) && ($parserState->{afterSemi} == 2)) && do { # && ($parserState->{afterSemi} >= 2)) && do { + print STDERR "ISKEYWORD == 10: CASE KW_0B\n" if ($liteDebug); # print "AFTERSEMI: ".$parserState->{afterSemi}."\n" if ($parseDebug || $localDebug || $braceDebug); $parserState->{inCase}--; print STDERR "inCase -> ".$parserState->{inCase}."\n" if ($parseDebug || $localDebug || $braceDebug); @@ -2385,6 +2486,20 @@ $part = ""; last SWITCH; }; + + (length($TCLregexpcommand) && ($part =~ /^$TCLregexpcommand$/) && + ($parserState->{lastsymbol} eq ";" || $parserState->{afterNL} || + $lasttoken eq "[" + ) && + (!($inRegexp || $inRegexpTrailer || $parserState->{inString} || $parserState->{inComment} || $parserState->{inInlineComment} || $parserState->{inChar}))) && do { + print STDERR "TCL REGEXP: CASE 01A\n" if ($liteDebug); + $parserState->{inTCLRegExpCommand} = 1; + + # print STDERR "LS: $parserState->{lastsymbol} ANL: $parserState->{afterNL} LT: $lasttoken\n"; + + # Fall through + }; + (($lang eq "perl" || $lang eq "shell") && $part eq "<<" && !$parserState->{attributeState} && !$parserState->{parsedParamParse} && !$parserState->{inBrackets} && @@ -2401,6 +2516,7 @@ !$parserState->{classNameFound} && !$parserState->{inMacro} && !$parserState->{inMacroLine}) && do { + print STDERR "PERL OR SHELL MULTI-LINE STRING: CASE 01B\n" if ($liteDebug); $parserState->{inString} = 13; $parserState->{endOfString} = ""; @@ -2411,15 +2527,18 @@ last SWITCH; }; (($lang eq "perl" || $lang eq "shell") && ($parserState->{inString} == 13) && ($parserState->{endOfString} eq "") && $part =~ /\S/) && do { + print STDERR "PERL OR SHELL MULTI-LINE STRING: CASE 01C\n" if ($liteDebug); $parserState->{endOfString} = $part; last SWITCH; }; (($lang eq "perl" || $lang eq "shell") && ($parserState->{inString} == 13) && ($part =~ /[\n\r]/)) && do { + print STDERR "PERL OR SHELL MULTI-LINE STRING: CASE 01D\n" if ($liteDebug); $parserState->{firstpastnl} = 1; last SWITCH; }; (($lang eq "perl" || $lang eq "shell") && ($parserState->{inString} == 13) && ($part eq $parserState->{endOfString}) && $parserState->{firstpastnl}) && do { + print STDERR "PERL OR SHELL MULTI-LINE STRING: CASE 01E\n" if ($liteDebug); $treeCur->addSibling($part, 0); $treeSkip = 1; $treeCur = pop(@treeStack) || $treeTop; $treeCur->parsedParamCopy(\@{$parserState->{parsedParamList}}, $lang, $sublang); @@ -2431,11 +2550,13 @@ }; (($lang eq "perl" || $lang eq "shell") && ($parserState->{inString} == 13) && $part =~ /\S/ && $parserState->{firstpastnl}) && do { + print STDERR "PERL OR SHELL MULTI-LINE STRING: CASE 01F\n" if ($liteDebug); $parserState->{firstpastnl} = 0; last SWITCH; }; (($lang eq "perl" || $lang eq "shell") && ($parserState->{inString} == 13)) && do { + print STDERR "PERL OR SHELL MULTI-LINE STRING: CASE 01G\n" if ($liteDebug); last SWITCH; }; @@ -2521,6 +2642,7 @@ last SWITCH; }; ($parserState->{inMacro} == 1 && ($part ne $parseTokens{soc}) && ($part ne $parseTokens{eoc}) && $part =~ /\s/) && do { + print STDERR "INMACRO SPACE: CASE 04A\n" if ($liteDebug); $treepart = $part; $part = ""; last SWITCH; }; @@ -2586,7 +2708,7 @@ if ($part =~ /[\{\(]/o) { push(@braceStack, $part); push(@parsedParamParseStack, $parserState->{parsedParamParse}); - print STDERR "PUSHED $part ONTO BRACESTACK\n" if ($macroDebug || $braceDebug); + print STDERR "PUSHED $part ONTO BRACESTACK [1]\n" if ($macroDebug || $braceDebug); } elsif ($part =~ /[\}\)]/o) { if ($part ne peekmatch(\@braceStack, $lang, $fullpath, $inputCounter)) { if ($parserState->{macroNoTrunc} == 1) { @@ -2596,7 +2718,7 @@ } my $temp = pop(@braceStack); $parserState->{parsedParamParse} = pop(@parsedParamParseStack); - print STDERR "POPPED $temp FROM BRACESTACK\n" if ($macroDebug || $braceDebug); + print STDERR "POPPED $temp FROM BRACESTACK [1]\n" if ($macroDebug || $braceDebug); } if ($part =~ /\S/o) { @@ -2627,6 +2749,7 @@ # Fall through. }; (length($parseTokens{constname}) && $part eq $parseTokens{constname} && !($inRegexp || $inRegexpTrailer || $parserState->{inString} || $parserState->{inComment} || $parserState->{inInlineComment} || $parserState->{inChar}) && (!(scalar(@braceStack) - $parserState->{initbsCount}))) && do { + print STDERR "CONST: CASE 06B\n" if ($liteDebug); $parserState->{constKeywordFound} = 1; print STDERR "DETECTED CONSTANT KEYWORD\n" if ($localDebug || $parseDebug); @@ -2656,26 +2779,36 @@ $inRegexpFirstPart = 2; last SWITCH; }; # end regexppattern - (($inRegexp || $parserState->{lastsymbol} eq "~" || - ((!$inRegexp) && - ($parserState->{lastsymbol} =~ /[=,(]/ || - ($parserState->{lastsymbol} eq "" && $lastnspart eq "(" && peek(\@braceStack) eq "(") - ) && $part =~ /\// && !$parserState->{inTemplate} && - length($regexpcharpattern) && - !($inRegexp || $inRegexpTrailer || - $parserState->{inString} || $parserState->{inComment} || - $parserState->{inInlineComment} || $parserState->{inChar}) - ) - ) && - (length($regexpcharpattern) && - $part =~ /^($regexpcharpattern)$/ && - (!$inRegexpCharClass) && - (!scalar(@regexpStack) || $part eq peekmatch(\@regexpStack, $lang, $fullpath, $inputCounter)) - ) + (($inRegexp && + (length($regexpcharpattern) && + $part =~ /^($regexpcharpattern)$/ && + (!$inRegexpCharClass) && + (!scalar(@regexpStack) || $part eq peekmatch(\@regexpStack, $lang, $fullpath, $inputCounter)) + ) + ) || ( + (!$inRegexp) && + ($parserState->{lastsymbol} =~ /$regexpAllowedAfter/ || + ($parseTokens{regexpAllowedAtStartOfLine} && $parserState->{afterNL}) || + $parserState->{inTCLRegExpCommand} || + ($parserState->{lastsymbol} eq "" && $lastnspart eq "(" && peek(\@braceStack) eq "(") + ) && + length($regexpfirstcharpattern) && + $part =~ /$regexpfirstcharpattern/ && !$parserState->{inTemplate} && + (!($inRegexp || $inRegexpTrailer || + $parserState->{inString} || $parserState->{inComment} || + $parserState->{inInlineComment} || $parserState->{inChar})) && + (!$parserState->isRubyOpenQuote($part) || $parserState->isRubyCloseQuote($part)) && + (!$inRegexpCharClass) && + (!scalar(@regexpStack) || $part eq peekmatch(\@regexpStack, $lang, $fullpath, $inputCounter)) + ) ) && do { print STDERR "REGEXP CHARACTER: CASE 08\n" if ($liteDebug); print STDERR "REGEXP?\n" if ($regexpDebug); + if ($parserState->{inTCLRegExpCommand}) { + $parserState->{inTCLRegExpCommand} = 0; + } + # if ($lasttoken eq "\\") if ($parserState->isQuoted($lang, $sublang) || ((!$inRegexp) && $lasttoken eq "\$")) { @@ -2941,7 +3074,13 @@ $postPossNL = 2; } elsif ($treePopOnNewLine && $prev_inInlineComment) { # print STDERR "TPONL: $treePopOnNewLine\n"; - print STDERR "Keeping parsed parameter $parsedParam because we're leaving a single-line comment.\n" if ($parmDebug || $cppDebug || $localDebug); + if ($parserState->{inMacroLine}) { + print STDERR "skipped pushing CPP directive $parsedParam into parsedParamList [0]\n" if ($parmDebug || $cppDebug || $localDebug); + $parserState->{inMacroLine} = 0; + $parsedParam = ""; + } else { + print STDERR "Keeping parsed parameter $parsedParam because we're leaving a single-line comment.\n" if ($parmDebug || $cppDebug || $localDebug); + } } else { if ($parserState->{inMacroLine}) { print STDERR "skipped pushing CPP directive $parsedParam into parsedParamList [1]\n" if ($parmDebug || $cppDebug || $localDebug); @@ -2987,7 +3126,7 @@ $treeCur = pop(@treeStack); if (!$treeCur) { $treeCur = $treeTop; - warn "$fullpath:$inputCounter: warning: Attempted to pop off top of tree\n"; + warn "$fullpath:$inputCounter: warning: Attempted to pop off top of tree"; } $treeCur->parsedParamCopy(\@{$parserState->{parsedParamList}}, $lang, $sublang); $treeCur = $treeCur->lastSibling(); @@ -3004,7 +3143,7 @@ $treeCur = pop(@treeStack); if (!$treeCur) { $treeCur = $treeTop; - warn "$fullpath:$inputCounter: warning: Attempted to pop off top of tree\n"; + warn "$fullpath:$inputCounter: warning: Attempted to pop off top of tree"; } $treeCur->parsedParamCopy(\@{$parserState->{parsedParamList}}, $lang, $sublang); $treeCur = $treeCur->lastSibling(); @@ -3037,7 +3176,7 @@ $parserState->{onlyComments} = 0; push(@parsedParamParseStack, $parserState->{parsedParamParse}); push(@braceStack, $part); pbs(@braceStack); - print STDERR "PUSHED $part ONTO BRACESTACK\n" if ($macroDebug || $braceDebug); + print STDERR "PUSHED $part ONTO BRACESTACK [2]\n" if ($macroDebug || $braceDebug); print STDERR "LINE: $line\n" if ($regexpDebug && $braceDebug); if (!$parserState->{seenBraces}) { # TREEDONE $treeNest = 1; @@ -3065,7 +3204,7 @@ } my $top = pop(@braceStack); $parserState->{parsedParamParse} = pop(@parsedParamParseStack); - print STDERR "POPPED $top FROM BRACESTACK\n" if ($macroDebug || $braceDebug); + print STDERR "POPPED $top FROM BRACESTACK [2]\n" if ($macroDebug || $braceDebug); if (!$parserState->{seenBraces}) { # TREEDONE $treeCur->addSibling($part, 0); $treeSkip = 1; $treeCur = pop(@treeStack) || $treeTop; @@ -3089,6 +3228,7 @@ last SWITCH; }; ($ruby && ($part eq "<") && ($parserState->{sodclass} eq "class")) && do { + print STDERR "RUBY LEFT ANGLE BRACE: CASE 15A\n" if ($liteDebug); if (!($parserState->{inString} || $parserState->{inComment} || $parserState->{inInlineComment} || $parserState->{inChar}) && (!(scalar(@braceStack)-$parserState->{initbsCount}))) { $parserState->{waitingForExceptions} = 1; } @@ -3201,6 +3341,7 @@ } }; (length($requiredregexp) && $part =~ /$requiredregexp/) && do { + print STDERR "REQUIRED REGEXP: CASE 17A\n" if ($liteDebug); print STDERR "REQUIRED REGEXP MATCH: \"$part\"\n" if ($localDebug || $parseDebug); $hollowskip = 1; print STDERR "hollowskip -> 1 (requiredregexp)\n" if ($parserStateInsertDebug); @@ -3377,6 +3518,7 @@ $fall_through = 1; } elsif (!$parserState->isQuoted($lang, $sublang)) { if ($inRegexp && $inRegexpFirstPart == 1) { + print STDERR "inRegexpCharClass -> 3\n" if ($regexpDebug); $inRegexpCharClass = 3; } print STDERR "lbracket\n" if ($localDebug); @@ -3388,7 +3530,7 @@ } push(@parsedParamParseStack, $parserState->{parsedParamParse}); push(@braceStack, $part); pbs(@braceStack); - print STDERR "PUSHED $part ONTO BRACESTACK\n" if ($macroDebug || $braceDebug); + print STDERR "PUSHED $part ONTO BRACESTACK [3]\n" if ($macroDebug || $braceDebug); if (!$parserState->{seenBraces}) { # TREEDONE $treeNest = 1; if ($treeDebug) { print STDERR "TS TREENEST -> 1 [11]\n"; } @@ -3460,7 +3602,7 @@ } my $top = pop(@braceStack); $parserState->{parsedParamParse} = pop(@parsedParamParseStack); - print STDERR "POPPED $top FROM BRACESTACK\n" if ($macroDebug || $braceDebug); + print STDERR "POPPED $top FROM BRACESTACK [3]\n" if ($macroDebug || $braceDebug); if (!$parserState->{seenBraces}) { # TREEDONE $treeCur->addSibling($part, 0); $treeSkip = 1; $treeCur = pop(@treeStack) || $treeTop; @@ -3791,7 +3933,7 @@ } push(@parsedParamParseStack, $oldParsedParamParse); push(@braceStack, $part); pbs(@braceStack); - print STDERR "PUSHED $part ONTO BRACESTACK\n" if ($macroDebug || $braceDebug); + print STDERR "PUSHED $part ONTO BRACESTACK [4]\n" if ($macroDebug || $braceDebug); if (!$parserState->{seenBraces}) { # TREEDONE $treeNest = 1; if ($treeDebug) { print STDERR "TS TREENEST -> 1 [15]\n"; } @@ -3915,7 +4057,9 @@ my $test = pop(@braceStack); pbs(@braceStack); $parserState->{parsedParamParse} = pop(@parsedParamParseStack); - print STDERR "POPPED $test FROM BRACESTACK\n" if ($macroDebug || $braceDebug); + print STDERR "POPPED $test FROM BRACESTACK [4]\n" if ($macroDebug || $braceDebug); + + print STDERR "RPAREN SEENBRACES: ".$parserState->{seenBraces}."\n" if ($localDebug || $parserStateInsertDebug); if (!$parserState->{seenBraces}) { # TREEDONE $treeCur->addSibling($part, 0); $treeSkip = 1; $treeCur = pop(@treeStack) || $treeTop; @@ -4001,6 +4145,10 @@ print STDERR "bracePending -> 0 [brace]\n" if ($localDebug); $parserState->{onlyComments} = 0; print STDERR "[k]onlyComments -> 0\n" if ($macroDebug); + + push(@{$parserState->{parsedParamStateAtBrace}}, $parserState->{parsedParamParse}); + push(@{$parserState->{parsedParamAtBrace}}, $parsedParam); + $parsedParam = ""; if (scalar(@{$parserState->{parsedParamList}})) { foreach my $node (@{$parserState->{parsedParamList}}) { $node =~ s/^\s*//so; @@ -4046,7 +4194,7 @@ push(@parsedParamParseStack, $oldParsedParamParse); push(@braceStack, $brctoken); pbs(@braceStack); - print STDERR "PUSHED $brctoken ONTO BRACESTACK\n" if ($macroDebug || $braceDebug); + print STDERR "PUSHED $brctoken ONTO BRACESTACK [5]\n" if ($macroDebug || $braceDebug); if (!$parserState->{seenBraces}) { # TREEDONE $treeNest = 1; if ($treeDebug) { print STDERR "TS TREENEST -> 1 [16]\n"; } @@ -4078,9 +4226,10 @@ } last SWITCH; }; - (casecmp($part, $parseTokens{rbrace}, $case_sensitive) && ($parserState->{pendingBracedParameters} != 2) && ($lang ne "perl" || !($parserState->{inTemplate} || $inRegexp || $leavingRegexp))) && do { + ((casecmp($part, $parseTokens{rbrace}, $case_sensitive) || $parserState->{inrbraceargument}) && ($parserState->{pendingBracedParameters} != 2) && ($lang ne "perl" || !($parserState->{inTemplate} || $inRegexp || $leavingRegexp))) && do { # {Treat } within <> as ordinary character in Perl. print STDERR "RIGHT BRACE: CASE 31\n" if ($liteDebug); + print STDERR "INBRACEARGUMENT: ".$parserState->{inrbraceargument}."\n" if ($parserStateInsertDebug); if (!($parserState->{inString} || $parserState->{inComment} || $parserState->{inInlineComment} || $parserState->{inChar} || $inRegexp)) { my $oldOC = $parserState->{onlyComments}; @@ -4090,13 +4239,29 @@ print STDERR "[l]onlyComments -> 0\n" if ($macroDebug); if ($ruby) { $parserState->{followingrubyrbrace} = 1; } + if (($parseTokens{rbracetakesargument}) && (!$parserState->{inrbraceargument})) { + $parserState->{inrbraceargument} = 1; + # $treePopOnNewLine = 1; + # $parserState->{newlineIsSemi} = 1; + } elsif ($parserState->{inrbraceargument} && $part =~ /\w/) { + $parserState->{inrbraceargument}--; + if ($parserState->{seenBraces}) { $trailingHide = 1; } + } - my $bsCount = scalar(@braceStack); + if ($parserState->{inrbraceargument}) { + print STDERR "Waiting for rbrace argument\n" if ($asDebug || $parserStackDebug || $parseDebug || $braceDebug); + } else { + print STDERR "INRBRACEARGUMENT: ".$parserState->{inrbraceargument}."\n" if ($asDebug || $parserStackDebug || $parseDebug || $braceDebug); + + my $bsCount = scalar(@braceStack); - print STDERR "SPS: ".scalar(@parserStack)." BSC: ".$bsCount." IBSC: ".$parserState->{initbsCount}."\n" if ($rubyDebug || $parseDebug); - if (scalar(@parserStack) && !($bsCount - $parserState->{initbsCount})) { + print STDERR "SPS: ".scalar(@parserStack)." BSC: ".$bsCount." IBSC: ".$parserState->{initbsCount}."\n" if ($rubyDebug || $parseDebug); + if (scalar(@parserStack) && !($bsCount - $parserState->{initbsCount})) { print STDERR "parserState: ENDOFSTATE\n" if ($parserStackDebug); - if ($parserState->{noInsert} || $oldOC) { + if ($parserState->{inrbraceargument}) { + print STDERR "parserState insertion skipped[RBRACE, INARG]\n" if ($parserStackDebug || $parserStateInsertDebug); + # $parserState->{newlineIsSemi} = 1; # @@@ THIS ISN'T RIGHT. + } elsif ($parserState->{noInsert} || $oldOC) { print STDERR "parserState insertion skipped[RBRACE]\n" if ($parserStackDebug || $parserStateInsertDebug); } elsif ($parserState->{hollow}) { print STDERR "inserted parser state into tree [RBRACE]\n" if ($parserStateInsertDebug); @@ -4127,7 +4292,7 @@ $part = ""; print STDERR "INMODULE -> 3\n" if ($localDebug || $moduleDebug); $parserState->{INMODULE} = 3; - print STDERR "CONTINUE -> 0 [1a]\n" if ($parseDebug || $cppDebug || $macroDebug || $localDebug || $continueDebug); + print STDERR "CONTINUE -> 0 [1aMODULE]\n" if ($parseDebug || $cppDebug || $macroDebug || $localDebug || $continueDebug); $parserState->{noInsert} = 0; $continue = 0; # print STDERR "AT END: REALPS IS ".$parserState->{REALPS}."\n" if ($parserStackDebug || $localDebug); @@ -4136,12 +4301,12 @@ # print STDERR "HERE\n"; - if ($lang eq "php" || ($lang eq "C" && $sublang eq "IDL") || ($lang eq "java" && $sublang eq "java") || $ruby || ($lang eq "tcl")) { + if ($lang eq "php" || ($lang eq "C" && $sublang eq "IDL") || ($lang eq "java" && $sublang eq "java") || $ruby || ($lang eq "tcl") || ($lang eq "applescript")) { # print STDERR "PHP OUT OF BRACES?: ".scalar(@braceStack)."\n"; if (scalar(@braceStack) == 1) { # PHP, IDL, Ruby, TCL, and Java classes end at # the brace. - print STDERR "CONTINUE -> 0 [1a]\n" if ($parseDebug || $cppDebug || $macroDebug || $localDebug || $continueDebug); + print STDERR "CONTINUE -> 0 [1aOutOfBraces]\n" if ($parseDebug || $cppDebug || $macroDebug || $localDebug || $continueDebug); $continue = 0; } } @@ -4157,12 +4322,12 @@ $parserState->{initbsCount} = scalar(@braceStack) - 1; } # $parserState->{onlyComments} = 1; - } else { + } else { print STDERR "NO CHANGE IN PARSER STATE STACK (nPARSERSTACK = ".scalar(@parserStack).", $bsCount != $parserState->{initbsCount})\n" if ($parseDebug || $parserStackDebug); - } + } - print STDERR "Ruby stopcheck: ".scalar(@braceStack)." - ".$parserState->{initbsCount}."\n" if ($rubyDebug || $parseDebug); - if ((scalar(@braceStack)-$parserState->{initbsCount}) == 1) { + print STDERR "Ruby stopcheck: ".scalar(@braceStack)." - ".$parserState->{initbsCount}."\n" if ($rubyDebug || $parseDebug); + if ((scalar(@braceStack)-$parserState->{initbsCount}) == 1) { # stop parameter parsing if ($ruby) { print STDERR "Ruby stopearly: ".scalar(@braceStack)." - ".$parserState->{initbsCount}."\n" if ($rubyDebug || $parseDebug);; @@ -4185,14 +4350,15 @@ # } else { # print STDERR "checkpoint SC: ".$parserState->{sodclass}."\n"; # } - } else { + } else { # start parameter parsing after this token # grabbing end names for typedefs. - $parserState->{parsedParamParse} = 4; + $parserState->{parsedParamParse} = pop(@{$parserState->{parsedParamStateAtBrace}}); # 4; + $parsedParam = pop(@{$parserState->{parsedParamAtBrace}}); print STDERR "parsedParamParse -> $parserState->{parsedParamParse}"."[rbrace2]\n" if ($parmDebug); - } + } - if (scalar(@{$parserState->{parsedParamList}})) { + if (scalar(@{$parserState->{parsedParamList}})) { foreach my $node (@{$parserState->{parsedParamList}}) { $node =~ s/^\s*//so; $node =~ s/\s*$//so; @@ -4202,13 +4368,13 @@ } @{$parserState->{parsedParamList}} = (); print STDERR "parsedParamList pushed [3]\n" if ($parmDebug); - } + } - print STDERR "rbrace\n" if ($localDebug); + print STDERR "rbrace\n" if ($localDebug); - my $test = pop(@braceStack); pbs(@braceStack); - my $temp = pop(@parsedParamParseStack); - if ($temp) { + my $test = pop(@braceStack); pbs(@braceStack); + my $temp = pop(@parsedParamParseStack); + if ($temp) { if ($temp == 1) { $temp = 2; } elsif ($temp == 3) { $temp = 4; } @@ -4216,9 +4382,10 @@ warn("Changing PPP from ".$parserState->{parsedParamParse}." to $temp\n"); } $parserState->{parsedParamParse} = $temp; - } - print STDERR "POPPED $test FROM BRACESTACK\n" if ($macroDebug || $braceDebug); - if (!$parserState->{seenBraces}) { # TREEDONE + } + print STDERR "POPPED $test FROM BRACESTACK [5]\n" if ($macroDebug || $braceDebug); + if ((!($parserState->{seenBraces} || $trailingHide)) && (!$parserState->{inrbraceargument})) { # TREEDONE + warn("TSPOP FOR NOT SEEN BRACES\n") if ($parserStateInsertDebug || $treeDebug); $treeCur->addSibling($part, 0); $treeSkip = 1; $treeCur = pop(@treeStack) || $treeTop; $treeCur->parsedParamCopy(\@{$parserState->{parsedParamList}}, $lang, $sublang); @@ -4226,25 +4393,26 @@ $treeCur->parsedParamCopy(\@{$parserState->{parsedParamList}}, $lang, $sublang); print STDERR "TSPOP [7]: now $treeCur\n" if ($tsDebug || $treeDebug); bless($treeCur, "HeaderDoc::ParseTree"); - } - if (!($test eq "$parseTokens{lbrace}") && (!length($parseTokens{structname}) || (!($test eq $parseTokens{structname}) && $parseTokens{structisbrace}))) { + } + if (!($test eq "$parseTokens{lbrace}") && (!length($parseTokens{structname}) || (!($test eq $parseTokens{structname}) && $parseTokens{structisbrace}))) { warn("$fullpath:$inputCounter: warning: Braces do not match (top of brace stack\nis \"$test\").We may have a problem.\n"); warn("Declaration to date: $declaration$curline\n"); - } - $curline = spacefix($curline, $part, $lastchar); - $parserState->{lastsymbol} = ""; - $lastchar = $part; - - $parserState->{startOfDec} = 0; - print STDERR "startOfDec -> 0 [6]\n" if ($localDebug); - if ($curline !~ /\S/o) { + } + $curline = spacefix($curline, $part, $lastchar); + $parserState->{lastsymbol} = ""; + $lastchar = $part; + + $parserState->{startOfDec} = 0; + print STDERR "startOfDec -> 0 [6]\n" if ($localDebug); + if ($curline !~ /\S/o) { # This is the first symbol on the line. # adjust immediately $prespace -= 4; print STDERR "PS: $prespace immediate\n" if ($localDebug); - } else { + } else { $prespaceadjust -= 4; print STDERR "PSA: $prespaceadjust\n" if ($localDebug); + } } } last SWITCH; @@ -4304,7 +4472,7 @@ $parserState->{seenBraces} = 1; my $temp = pop(@braceStack); $parserState->{parsedParamParse} = pop(@parsedParamParseStack); - print STDERR "POPPED $temp FROM BRACESTACK\n" if ($macroDebug || $braceDebug); + print STDERR "POPPED $temp FROM BRACESTACK [6]\n" if ($macroDebug || $braceDebug); $treeCur->addSibling($part, 0); $treeSkip = 1; $treeCur = pop(@treeStack) || $treeTop; $treeCur->parsedParamCopy(\@{$parserState->{parsedParamList}}, $lang, $sublang); @@ -4424,7 +4592,7 @@ print STDERR "CLASS ($localclasstype) IS A BRACE.\n" if ($localDebug); push(@parsedParamParseStack, $parserState->{parsedParamParse}); push(@braceStack, $localclasstype); pbs(@braceStack); - print STDERR "PUSHED $localclasstype ONTO BRACESTACK\n" if ($macroDebug || $braceDebug); + print STDERR "PUSHED $localclasstype ONTO BRACESTACK [6]\n" if ($macroDebug || $braceDebug); $treeNest = 1; if ($treeDebug) { print STDERR "TS TREENEST -> 1 [17]\n"; } # } else { @@ -4457,6 +4625,12 @@ # $macrore = macroRegexpFromList($parseTokens{macronames}); $macrore_pound = macroRegexpFromList($parseTokens{macronames}, 1); $macrore_nopound = macroRegexpFromList($parseTokens{macronames}, 2); + $regexppattern = $parseTokens{regexppattern}; + $singleregexppattern = $parseTokens{singleregexppattern}; + $regexpfirstcharpattern = $parseTokens{regexpfirstcharpattern}; + $regexpcharpattern = $parseTokens{regexpcharpattern}; + $regexpAllowedAfter = $parseTokens{regexpAllowedAfter}; + $TCLregexpcommand = $parseTokens{TCLregexpcommand}; print STDERR "ARP: $accessregexp\n" if ($localDebug); @@ -4486,6 +4660,12 @@ # $macrore = macroRegexpFromList($parseTokens{macronames}); $macrore_pound = macroRegexpFromList($parseTokens{macronames}, 1); $macrore_nopound = macroRegexpFromList($parseTokens{macronames}, 2); + $regexppattern = $parseTokens{regexppattern}; + $singleregexppattern = $parseTokens{singleregexppattern}; + $regexpfirstcharpattern = $parseTokens{regexpfirstcharpattern}; + $regexpcharpattern = $parseTokens{regexpcharpattern}; + $regexpAllowedAfter = $parseTokens{regexpAllowedAfter}; + $TCLregexpcommand = $parseTokens{TCLregexpcommand}; print STDERR "ARP: $accessregexp\n" if ($localDebug); @@ -4538,8 +4718,8 @@ push(@parsedParamParseStack, $parserState->{parsedParamParse}); push(@braceStack, $part); pbs(@braceStack); - print STDERR "PUSHED $part ONTO BRACESTACK\n" if ($macroDebug || $braceDebug); - if (!$parserState->{seenBraces}) { # TREEDONE + print STDERR "PUSHED $part ONTO BRACESTACK [7]\n" if ($macroDebug || $braceDebug); + if (!($parserState->{seenBraces} || $trailingHide)) { # TREEDONE $treeNest = 1; if ($treeDebug) { print STDERR "TS TREENEST -> 1 [18]\n"; } # push(@treeStack, $treeCur); @@ -4655,6 +4835,7 @@ # Punctuation handlers ($part =~ /;/o || ($parserState->{newlineIsSemi} && (!$parserState->isQuoted($lang, $sublang)) && $part =~ /[\n\r]/)) && do { + # semicolon handler. print STDERR "SEMICOLON: CASE 39\n" if ($liteDebug); if (!($parserState->{inString} || $parserState->{inComment} || $parserState->{inInlineComment} || $parserState->{inChar})) { if ($lang eq "shell") { @@ -4664,6 +4845,9 @@ $parserState->{afterSemi} = 1; } } + if ($parserState->{inTCLRegExpCommand}) { + $parserState->{inTCLRegExpCommand} = 0; + } print STDERR "NOT IN STRING, CHAR, COMMENT, etc.\n" if ($localDebug); if ($parserState->{parsedParamParse}) { print STDERR "PPP IS $parserState->{parsedParamParse}.\n" if ($localDebug); @@ -4857,6 +5041,7 @@ }; # end if }; # end do ($part =~ /[*^]/) && do { + print STDERR "PUNCTUATION: CASE 41A\n" if ($liteDebug); if ($part =~ /[*]/) { $parserState->{curvarstars} .= $part; } if ($lastnspart eq "(" && # ")" !($parserState->{inString} || $parserState->{inComment} || $parserState->{inInlineComment} || $parserState->{inChar}) && @@ -5143,7 +5328,7 @@ # Note: don't check tempInIf here. We want the open brace included because # the close brace is included. - if ($parserState->{seenBraces} && ($parserState->{INIF} != 1)) { + if (($parserState->{seenBraces} || $trailingHide) && ($parserState->{INIF} != 1)) { # print STDERR "SEENBRACES. TP: $treepart PT: $part\n"; if ($treepart) { print STDERR "ADDED \"$treepart\" to function contents\n" if ($functionContentsDebug); @@ -5153,7 +5338,7 @@ $parserState->{functionContents} .= $part; } # print STDERR "SEENBRACES. FC: ".$parserState->{functionContents}."\n"; - } elsif ($parserState->{seenBraces}) { + } elsif ($parserState->{seenBraces} || $trailingHide) { print STDERR "NOT ADDING \"$part\" to function contents (INIF: ".$parserState->{INIF}." TEMPINIF: $tempInIf\n" if ($functionContentsDebug); } else { print STDERR "NOT ADDING \"$part\" to function contents (!seenBraces)\n" if ($functionContentsDebug); @@ -5190,7 +5375,7 @@ print STDERR "TN: $treeNest TS: $treeSkip nTS: ".scalar(@treeStack)."\n" if ($tsDebug || $parserStateInsertDebug); print STDERR "sethollow: $sethollow\n" if ($parserStateInsertDebug); if (!$treeSkip) { - if (!$parserState->{seenBraces}) { # TREEDONE + if (!($parserState->{seenBraces} || $trailingHide)) { # TREEDONE if ($treeNest != 2) { # If we really want to skip and nest, set treeNest to 2. if (length($treepart)) { @@ -5264,6 +5449,8 @@ print STDERR "REPLACING RETURNTYPE[3]: NOW \"$parserState->{returntype}\".\n" if ($retDebug); } + print STDERR "AT MIDPOINT, TREECUR IS $treeCur (".$treeCur->token().")\n" if ($localDebug || $parserStateInsertDebug); + # From here down is... magic. This is where we figure out how # to handle parsed parameters, K&R C types, and in general, # determine whether we've received a complete declaration or not. @@ -5294,7 +5481,7 @@ } $ppSkipOneToken = 0; print STDERR "MIDPOINT CL: $curline\nDEC:$declaration\nSCR: \"$scratch\"\n" if ($localDebug); - if (!$parserState->{seenBraces}) { + if (!($parserState->{seenBraces} || $trailingHide)) { # Add to current line (but don't put inline function/macro # declarations in. @@ -5410,7 +5597,7 @@ $parserState->{declarationEndsAtNewLine} = 0; } # print STDERR "DPA\n"; - if ((!$parserState->{kr_c_function} || $parserState->{seenBraces}) && !$parserState->{inMacro}) { + if ((!$parserState->{kr_c_function} || $parserState->{seenBraces} || $trailingHide) && !$parserState->{inMacro}) { print STDERR "DPB\n" if ($parserStateInsertDebug); if (!scalar(@parserStack)) { $continue = 0; @@ -5454,12 +5641,12 @@ } # print STDERR "BSCOUNT: $bsCount IBS: $parserState->{initbsCount}\n"; - if (!($bsCount - $parserState->{initbsCount}) && $parserState->{seenBraces} && ($parserState->{sodclass} eq "function" || $parserState->{inOperator}) && + if (!($bsCount - $parserState->{initbsCount}) && ($parserState->{seenBraces} || $trailingHide) && ($parserState->{sodclass} eq "function" || $parserState->{inOperator}) && ($nextpart ne ";")) { # Function declarations end at the close curly brace. # No ';' necessary (though we'll eat it if it's there. - if ($parserState->{treePopTwo} || $ruby) { + if ($parserState->{treePopTwo} || $ruby || $parseTokens{functionisbrace}) { # Fix nesting. # print STDERR "LASTTREENODE -> $treeCur (".$treeCur->token().")\n"; while ($parserState->{treePopTwo}--) { @@ -5470,7 +5657,7 @@ print STDERR "TSPOP [13]: now $treeCur\n" if ($tsDebug || $treeDebug); bless($treeCur, "HeaderDoc::ParseTree"); } - if ($ruby) { + if ($ruby || $parseTokens{functionisbrace}) { $treeCur = $treeCur->addSibling("", 0); } else { $treeCur = $treeCur->addSibling(";", 0); @@ -5485,6 +5672,8 @@ if (!scalar(@parserStack) && !$parserState->{INIF} && !$tempInIf) { $continue = 0; print STDERR "CONTINUE -> 0 [4]\n" if ($parseDebug || $cppDebug || $macroDebug || $localDebug || $continueDebug); + } elsif ($parserState->{inrbraceargument}) { + print STDERR "parserState insertion skipped[inrbraceargument]\n" if ($parserStackDebug); } elsif (!$parserState->{onlyComments} && !$parserState->{INIF} && !$tempInIf) { # Process entry here if ($parserState->{noInsert}) { @@ -5493,7 +5682,7 @@ my $treeRef = $parserState->{hollow}; print STDERR "inserted parser state into tree [rbrace]\nEOD: $treeCur\n" if ($parserStateInsertDebug); - print STDERR "Last tree node set to $treeCur [9]\n" if ($parserStateInsertDebug); + print STDERR "Last tree node set to $treeCur [9] (token: \"".$treeCur->token()."\")\n" if ($parserStateInsertDebug); $parserState->{lastTreeNode} = $treeCur; $treeRef->addRawParsedParams(\@{$parserState->{parsedParamList}}); $treeRef->parserState($parserState); @@ -6531,7 +6720,7 @@ print STDERR "TYPELIST WAS \"$typelist\"\n" if ($localDebug);; # warn("left blockParse (macro)\n"); -# print STDERR "NumPPs: ".scalar(@parsedParamList)."\n"; +print STDERR "NumPPs: ".scalar(@parsedParamList)."\n" if ($localDebug); # $treeTop->printTree(); @@ -7243,18 +7432,18 @@ if ($token =~ /[\(\[]/o) { print STDERR "open paren/bracket - $token\n" if ($localDebug); push(@braceStack, $token); - print STDERR "PUSHED $token ONTO BRACESTACK\n" if ($braceDebug); + print STDERR "PUSHED $token ONTO BRACESTACK [8]\n" if ($braceDebug); } elsif ($token =~ /\)/o) { print STDERR "close paren\n" if ($localDebug); my $top = pop(@braceStack); - print STDERR "POPPED $top FROM BRACESTACK\n" if ($braceDebug); + print STDERR "POPPED $top FROM BRACESTACK [7]\n" if ($braceDebug); if ($top !~ /\(/o) { warn("$fullpath:$inputCounter: warning: Parentheses do not match (macro).\nWe may have a problem.\n"); } } elsif ($token =~ /\]/o) { print STDERR "close bracket\n" if ($localDebug); my $top = pop(@braceStack); - print STDERR "POPPED $top FROM BRACESTACK\n" if ($braceDebug); + print STDERR "POPPED $top FROM BRACESTACK [8]\n" if ($braceDebug); if ($top !~ /\[/o) { warn("$fullpath:$inputCounter: warning: Braces do not match (macro).\nWe may have a problem.\n"); } @@ -9048,7 +9237,7 @@ $posstypes, $outertype, $curtype, $classType, $classKeyword, $declaration, \@fields, $functionGroup, $varIsConstant, $blockmode, $inClass, $inInterface, $inTypedef, $inStruct, $fullpath, $inputCounter, $blockOffset, $lang, $sublang, 0, $functionContents, - $apiOwner, $subparseInputCounter, $subparseBlockOffset, $extendsClass, $implementsClass, 1); + $apiOwner, $subparseInputCounter, $subparseBlockOffset, $extendsClass, $implementsClass, 1, \%parseTokens); if ($mustLockDiscussion) { $curObj->prepareDiscussionForTemporary(); } @@ -9503,7 +9692,7 @@ \@fields, $functionGroup, $varIsConstant, $blockmode, $inClass, $inInterface, $inTypedef, $inStruct, $fullpath, $inputCounter, $blockOffset, $lang, $sublang, $outerLocalDebug, $functionContents, $apiOwner, $subparseInputCounter, $subparseBlockOffset, - $extendsClass, $implementsClass, 0); + $extendsClass, $implementsClass, 0, \%parseTokens); print "EXTRA ON RETURN IS $extra\n" if ($nameDebug || $nameObjDebug); } @@ -10037,8 +10226,13 @@ # print STDERR "ITD: $inTypedef\n"; print STDERR "B8X blockmode=$blockmode ts=$typestring\n" if ($localDebug || $hangDebug); my $typedefname = $parseTokens{typedefname}; + my $classregexp = $parseTokens{classregexp}; + my $moduleregexp = $parseTokens{moduleregexp}; - if (($typestring =~ /^(class|\@class|\@interface|\@implementation|\@protocol|interface|module|namespace|package)/ || $inClass) && !$inTypedef) { + # if (($typestring =~ /^(class|\@class|\@interface|\@implementation|\@protocol|interface|module|namespace|package)/ || $inClass) && !$inTypedef) + if (((length($classregexp) && $typestring =~ /$classregexp/) || + (length($moduleregexp) && $typestring =~ /$moduleregexp/) || $inClass) && + !$inTypedef) { print STDERR "ITSACLASS! ($extra->name)\n" if ($localDebug); $extra->declaration($declaration); $extra->declarationInHTML($declaration); @@ -10446,20 +10640,31 @@ my $extendsClass = shift; # IN my $implementsClass = shift; # IN my $alwaysProcessComment = shift; # IN + my $parseTokensRef = shift; # IN my $parserState = shift; # IN my $extra = undef; # OUT my $localDebug = 0; + my %parseTokens = %{$parseTokensRef}; + my $filename = basename($fullpath); print STDERR "FOR DECLARATION $declaration\n" if ($localDebug); # printFields($fieldref); + my $classregexp = $parseTokens{classregexp}; + my $moduleregexp = $parseTokens{moduleregexp}; + # print STDERR "CHECK: $classregexp\n"; + # print STDERR "CO: $curObj HASPC: ".$curObj->{HASPROCESSEDCOMMENT}." CURTYPE: $curtype\n"; + # print "TYPESTRING \"$typestring\" OUTERTYPE: \"$outertype\"\n"; + if ($typestring eq $outertype || !$HeaderDoc::outerNamesOnly) { - if (($typestring =~ /^(class|\@class|\@interface|\@implementation|\@protocol|interface|module|namespace|package)/ || $inClass) && !$inTypedef && !$inStruct) { + # $typestring =~ /^(class|\@class|\@interface|\@implementation|\@protocol|interface|module|namespace|package)/ + if (((length($classregexp) && $typestring =~ /$classregexp/) || + (length($moduleregexp) && $typestring =~ /$moduleregexp/) || $inClass) && !$inTypedef && !$inStruct) { print STDERR "blockParse returned class\n" if ($localDebug); print STDERR "RAWDEC: $declaration\n" if ($localDebug && $outerLocalDebug); $classType = classTypeFromFieldAndBPinfo($classKeyword, $typestring." ".$posstypes, $declaration, $fullpath, $inputCounter+$blockOffset, $sublang); @@ -10560,7 +10765,7 @@ # $headerObject->addToClasses($extra); # } - } elsif (($typestring =~ /^$typedefname/ && length($typedefname)) || $typestring =~ /^(class|\@class|\@interface|\@implementation|\@protocol)/) { + } elsif (($typestring =~ /^$typedefname/ && length($typedefname)) || ($typestring =~ /$classregexp/ && length($classregexp))) { print STDERR "blockParse returned $typedefname\n" if ($localDebug); if ($localDebug) { foreach my $field (@{$fieldref}) { Only in headerdoc-8.8.38-patched/Modules/HeaderDoc: BlockParse.pm.orig diff -ru headerdoc-8.8.38/Modules/HeaderDoc/Header.pm headerdoc-8.8.38-patched/Modules/HeaderDoc/Header.pm --- headerdoc-8.8.38/Modules/HeaderDoc/Header.pm 2011-02-18 19:07:45.000000000 -0800 +++ headerdoc-8.8.38-patched/Modules/HeaderDoc/Header.pm 2011-12-03 15:50:36.000000000 -0800 @@ -3,7 +3,7 @@ # Class name: Header # Synopsis: Holds header-wide comments parsed by headerDoc # -# Last Updated: $Date: 2011/02/18 19:02:58 $ +# Last Updated: $Date: 2011/05/26 15:50:22 $ # # Copyright (c) 1999-2004 Apple Computer, Inc. All rights reserved. # @@ -84,7 +84,7 @@ # In the git repository, contains the number of seconds since # January 1, 1970. # */ -$HeaderDoc::Header::VERSION = '$Revision: 1298084578 $'; +$HeaderDoc::Header::VERSION = '$Revision: 1306450222 $'; # Inheritance @ISA = qw( HeaderDoc::APIOwner ); @@ -480,6 +480,8 @@ my @categoryObjs = $self->categories(); $self->SUPER::writeHeaderElementsToCompositePage(); + return; + if ($self->classes()) { foreach my $obj (@classObjs) { $obj->writeHeaderElementsToCompositePage(); diff -ru headerdoc-8.8.38/Modules/HeaderDoc/HeaderElement.pm headerdoc-8.8.38-patched/Modules/HeaderDoc/HeaderElement.pm --- headerdoc-8.8.38/Modules/HeaderDoc/HeaderElement.pm 2011-05-19 16:40:59.000000000 -0700 +++ headerdoc-8.8.38-patched/Modules/HeaderDoc/HeaderElement.pm 2011-12-03 15:50:36.000000000 -0800 @@ -3,7 +3,7 @@ # Class name: HeaderElement # Synopsis: Root class for Function, Typedef, Constant, etc. -- used by HeaderDoc. # -# Last Updated: $Date: 2011/05/18 14:09:25 $ +# Last Updated: $Date: 2011/08/10 19:12:25 $ # # Copyright (c) 1999-2004 Apple Computer, Inc. All rights reserved. # @@ -255,7 +255,7 @@ # destroying this object to allow those references to be destroyed. # @var NAMESPACE # Contains a text string representing the namespace for this class. -# See {@link namespace}. +# See {@link //apple_ref/perl/instm/HeaderDoc::HeaderElement/namespace//() namespace}. # @var NOREGISTERUID # Set to 1 when an object's UID has been unregistered to prevent it from being # registered again. See {@link noRegisterUID}. @@ -328,7 +328,8 @@ # @var USESTDOUT # Set to 1 if the -P (pipe) flag is passed to HeaderDoc, else 0. # @var VALUE -# The value of a constant/variable. See {@link value}. +# The value of a constant/variable. +# See {@link //apple_ref/perl/instm/HeaderDoc::HeaderElement/value//() value}. # @var VARIABLES # An array of variables enclosed in a normal (usually function) object. These are # {@link //apple_ref/perl/cl/HeaderDoc::MinorAPIElement MinorAPIElement} objects. @@ -360,7 +361,7 @@ # In the git repository, contains the number of seconds since # January 1, 1970. # */ -$HeaderDoc::HeaderElement::VERSION = '$Revision: 1305752965 $'; +$HeaderDoc::HeaderElement::VERSION = '$Revision: 1313028745 $'; # /*! # @abstract @@ -2504,7 +2505,7 @@ # @param self # The current object. # @discussion -# The value is set with {@link throws}. +# The value is set with {@link //apple_ref/perl/instm/HeaderDoc::HeaderElement/throws//() throws}. # */ sub XMLthrows { my $self = shift; @@ -3894,7 +3895,7 @@ "try" => 1, "volatile" => 1, "while" => 1); - my %tclKeywords = ( ); # @@@ FIXME DAG @@@ + my %tclKeywords = ( "method" => 1, "constructor" => 1, "proc" => 1, "attribute" => 1 ); # Consider adding "regexp" command? # @@@ ADD "class" and fix bugs. my %perlKeywords = ( "sub" => 1, "my" => 8, "next" => 1, "last" => 1, "package" => 1 ); my %shellKeywords = ( "sub" => 1, "alias" => 1, @@ -5519,9 +5520,9 @@ my $uid = $element->apiuid(); # "econst"); # $contentString .= "$cName$cDesc\n"; - if (!$HeaderDoc::appleRefUsed{$uid} && !$HeaderDoc::ignore_apiuid_errors) { + if (!$apio->appleRefUsed($uid) && !$HeaderDoc::ignore_apiuid_errors) { # print STDERR "MARKING APIREF $uid used\n"; - $HeaderDoc::appleRefUsed{$uid} = 1; + $apio->appleRefUsed($uid, 1); $contentString .= "
$cName
$cDesc
\n"; } else { $contentString .= "
$cName
$cDesc
\n"; @@ -5671,11 +5672,12 @@ # $contentString .= "$cName$cDesc\n"; - if (!$HeaderDoc::appleRefUsed{$uid} && !$HeaderDoc::ignore_apiuid_errors) { - # print STDERR "MARKING APIREF $uid used\n"; - $HeaderDoc::appleRefUsed{$uid} = 1; + if (!$apio->appleRefUsed($uid) && !$HeaderDoc::ignore_apiuid_errors) { + # cluck("MARKING APIREF $uid used\n"); + $apio->appleRefUsed($uid, 1); $contentString .= "
$cName
$cDesc
\n"; } else { + # cluck("Reused Apple Ref $uid\n"); $contentString .= "
$cName
$cDesc
\n"; } } @@ -6424,6 +6426,7 @@ # my $methodType = $self->getMethodType($declarationRaw); my $methodType = $self->getMethodType(); $uid = $self->apiuid($methodType); + $extra = " type=\"$methodType\""; $isAPIOwner = 0; last SWITCH; }; @@ -6720,9 +6723,9 @@ if (length($fielduidtag)) { my $fielduid = $field->apiuid($fielduidtag); $fielduidstring = " id=\"$fielduid\""; - if (!$HeaderDoc::appleRefUsed{$uid} && !$HeaderDoc::ignore_apiuid_errors) { + if (!$apio->appleRefUsed($uid) && !$HeaderDoc::ignore_apiuid_errors) { # print STDERR "MARKING APIREF $uid used\n"; - $HeaderDoc::appleRefUsed{$uid} = 1; + $apio->appleRefUsed($uid, 1); } else { # already used or a "junk" run to obtain # uids for another purpose. Drop the @@ -6768,9 +6771,9 @@ if (length($fielduidtag)) { my $fielduid = $field->apiuid($fielduidtag); $fielduidstring = " id=\"$fielduid\""; - if (!$HeaderDoc::appleRefUsed{$uid} && !$HeaderDoc::ignore_apiuid_errors) { + if (!$apio->appleRefUsed($uid) && !$HeaderDoc::ignore_apiuid_errors) { # print STDERR "MARKING APIREF $uid used\n"; - $HeaderDoc::appleRefUsed{$uid} = 1; + $apio->appleRefUsed($uid, 1); } else { # already used or a "junk" run to obtain # uids for another purpose. Drop the diff -ru headerdoc-8.8.38/Modules/HeaderDoc/MinorAPIElement.pm headerdoc-8.8.38-patched/Modules/HeaderDoc/MinorAPIElement.pm --- headerdoc-8.8.38/Modules/HeaderDoc/MinorAPIElement.pm 2011-04-29 20:13:41.000000000 -0700 +++ headerdoc-8.8.38-patched/Modules/HeaderDoc/MinorAPIElement.pm 2011-12-03 15:50:36.000000000 -0800 @@ -3,7 +3,7 @@ # Class name: MinorAPIElement # Synopsis: Class for parameters and members of structs, etc. # -# Last Updated: $Date: 2011/04/29 19:46:01 $ +# Last Updated: $Date: 2011/05/26 14:13:20 $ # # Copyright (c) 1999-2008 Apple Computer, Inc. All rights reserved. # @@ -79,7 +79,7 @@ package HeaderDoc::MinorAPIElement; -use HeaderDoc::Utilities qw(findRelativePath safeName printArray printHash); +use HeaderDoc::Utilities qw(findRelativePath safeName printArray printHash registerUID); use HeaderDoc::HeaderElement; use Carp qw(cluck); @@ -95,7 +95,7 @@ # In the git repository, contains the number of seconds since # January 1, 1970. # */ -$HeaderDoc::MinorAPIElement::VERSION = '$Revision: 1304131561 $'; +$HeaderDoc::MinorAPIElement::VERSION = '$Revision: 1306444400 $'; # /*! @@ -373,10 +373,11 @@ # @param self # This MinorAPIElement object. # @discussion -# For special declarations (Perl instance variables), +# For special declarations (Perl instance variables, +# function-local variables, and so on), # returns a synthesized declaration from -# {@link AUTODECLARATION}. Otherwise, hands off the -# request to the superclass, +# {@link //apple_ref/perl/data/HeaderDoc::MinorAPIElement/AUTODECLARATION AUTODECLARATION}. +# Otherwise, hands off the request to the superclass, # {@link //apple_ref/perl/cl/HeaderDoc::HeaderElement HeaderElement}. # */ sub declaration @@ -392,10 +393,11 @@ # @param self # This MinorAPIElement object. # @discussion -# For special declarations (Perl instance variables), +# For special declarations (Perl instance variables, +# function-local variables, and so on), # returns a synthesized declaration from -# {@link AUTODECLARATION}. Otherwise, hands off the -# request to the superclass, +# {@link //apple_ref/perl/data/HeaderDoc::MinorAPIElement/AUTODECLARATION AUTODECLARATION}. +# Otherwise, hands off the request to the superclass, # {@link //apple_ref/perl/cl/HeaderDoc::HeaderElement HeaderElement}. # */ sub declarationInHTML @@ -407,17 +409,19 @@ # /*! # @abstract -# Gets/sets the {@link AUTODECLARATION} flag. +# Gets/sets the +# {@link //apple_ref/perl/data/HeaderDoc::MinorAPIElement/AUTODECLARATION AUTODECLARATION} +# value. # @param self # This MinorAPIElement object. # @param AUTODECLARATION # The new value to set. # @discussion -# For special declarations (Perl instance variables), -# returns a synthesized declaration from -# {@link AUTODECLARATION}. Otherwise, hands off the -# request to the superclass, -# {@link //apple_ref/perl/cl/HeaderDoc::HeaderElement HeaderElement}. +# For special declarations (Perl instance variables, +# function-local variables, and so on), declaration functions +# return a synthesized declaration based on the +# {@link //apple_ref/doc/functionparam/HeaderDoc::MinorAPIElement/autodeclaration/AUTODECLARATION AUTODECLARATION} +# parameter. This function supports that. # */ sub autodeclaration { @@ -487,10 +491,19 @@ $fieldtype = "enumconstant"; } elsif ($apioclass eq "HeaderDoc::Function") { $fieldtype = "functionparam"; + if ($self->autodeclaration()) { + $fieldtype = "functionvar"; + } } elsif ($apioclass eq "HeaderDoc::Method") { $fieldtype = "methodparam"; + if ($self->autodeclaration()) { + $fieldtype = "methodvar"; + } } elsif ($apioclass eq "HeaderDoc::PDefine") { $fieldtype = "defineparam"; + if ($self->autodeclaration()) { + $fieldtype = "definevar"; + } $include_class = 0; } elsif ($apioclass eq "HeaderDoc::Struct") { $fieldtype = "structfield"; @@ -516,6 +529,8 @@ $self->{APIUID} = $uid; + registerUID($uid, $self->rawname(), $self); + return $uid; } } diff -ru headerdoc-8.8.38/Modules/HeaderDoc/ParseTree.pm headerdoc-8.8.38-patched/Modules/HeaderDoc/ParseTree.pm --- headerdoc-8.8.38/Modules/HeaderDoc/ParseTree.pm 2011-05-06 20:08:46.000000000 -0700 +++ headerdoc-8.8.38-patched/Modules/HeaderDoc/ParseTree.pm 2011-12-03 15:50:36.000000000 -0800 @@ -2,7 +2,7 @@ # # Class name: ParseTree # Synopsis: Used by headerdoc2html to hold parse trees -# Last Updated: $Date: 2011/05/03 14:50:47 $ +# Last Updated: $Date: 2011/08/11 10:55:46 $ # # Copyright (c) 1999-2004 Apple Computer, Inc. All rights reserved. # @@ -153,13 +153,15 @@ # In the git repository, contains the number of seconds since # January 1, 1970. # */ -$HeaderDoc::ParseTree::VERSION = '$Revision: 1304459447 $'; +$HeaderDoc::ParseTree::VERSION = '$Revision: 1313085346 $'; ################ General Constants ################################### my $debugging = 0; my $apioDebug = 0; +# 0 = normal; 1 = debug; 2 = debug + backtraces my $treeDebug = 0; + my %defaults = ( # TOKEN => undef, # NEXT => undef, @@ -324,6 +326,7 @@ # print STDERR "addSibling $self\n"; print STDERR "addSibling $self \"$name\" HIDDEN: $hide\n" if ($treeDebug || $localDebug); + if ($treeDebug == 2) { cluck("backtrace"); } # Always hide siblings of descendants of elements that the parser # tells us to hide. Also spaces if they are the immediate successor @@ -389,6 +392,7 @@ # print STDERR "addChild\n"; print STDERR "addChild to $self \"$name\"\n" if ($treeDebug); + if ($treeDebug == 2) { cluck("backtrace"); } # If the parser wants a node hidden, any children of such a node # should be hidden, as should any siblings of those children or their diff -ru headerdoc-8.8.38/Modules/HeaderDoc/ParserState.pm headerdoc-8.8.38-patched/Modules/HeaderDoc/ParserState.pm --- headerdoc-8.8.38/Modules/HeaderDoc/ParserState.pm 2011-05-10 17:37:24.000000000 -0700 +++ headerdoc-8.8.38-patched/Modules/HeaderDoc/ParserState.pm 2011-12-03 15:55:11.000000000 -0800 @@ -2,7 +2,7 @@ # # Class name: ParserState # Synopsis: Used by headerDoc2HTML.pl to hold parser state -# Last Updated: $Date: 2011/05/10 17:36:18 $ +# Last Updated: $Date: 2011/12/03 10:08:35 $ # # Copyright (c) 1999-2004 Apple Computer, Inc. All rights reserved. # @@ -661,6 +661,12 @@ # do not precede the function body with any other # opening brace. # +# @var afterNL +# A nondestructive variant of {@link firstpastnl} that is available to +# any programming language (and currently used in TCL). +# Set to 2 after a newline, 1 during the first non-space +# token, 0 after. +# # @vargroup Parameter, attribute, asm, and availability parsing # # @var parsedParamParse @@ -801,6 +807,7 @@ # # @var lastTreeNode # The last node in the parse tree rooted at this node. +# This node is marked with EODEC in parse tree dumps. # # For example, the lastTreeNode value for # a class declaration would point to the closing brace @@ -1144,6 +1151,15 @@ # Reset to 0 after the first non-space token. Used in case/esac # parsing. # +# @vargroup TCL-specific variables +# +# @var inTCLRegExpCommand +# In TCL, set to 1 when a command is encountered that takes an +# unquoted (non-string) regular expression as an argument. +# +# Set to 0 upon entering the regular expression or when a +# newline or carriage return is encountered. +# # @vargroup Legacy junk variables # # @var simpleTDcontents @@ -1169,7 +1185,7 @@ # In the git repository, contains the number of seconds since # January 1, 1970. # */ -$HeaderDoc::ParserState::VERSION = '$Revision: 1305074178 $'; +$HeaderDoc::ParserState::VERSION = '$Revision: 1312390640_patched $'; ################ General Constants ################################### my $debugging = 0; @@ -1368,11 +1384,15 @@ my @arr1 = (); my @arr2 = (); my @arr3 = (); + my @arr4 = (); + my @arr5 = (); $self->{parsedParamList} = \@arr1; # currently active parsed parameter list. $self->{pplStack} = \@arr2; # stack of parsed parameter lists. Used to handle # fields and parameters in nested callbacks/structs. $self->{freezeStack} = \@arr3; # copy of pplStack when frozen. + $self->{parsedParamAtBrace} = \@arr4; # Any in-progress parsed parameters when we enter a brace. + $self->{parsedParamStateAtBrace} = \@arr5; # The state of parameter parsing when we enter a brace. my %orighash = %{$self}; @@ -1800,7 +1820,7 @@ if ($lang eq "perl" && $self->{inTemplate}) { return 0; } - if (($lang eq "ruby" || $lang eq "python") && (($curBraceCount - $self->{initbsCount}) > 1)) { + if ($classisbrace && (($curBraceCount - $self->{initbsCount}) > 1)) { # print STDERR "CBC: $curBraceCount INIT: ".$self->{initbsCount}."\n"; return 0; } Only in headerdoc-8.8.38-patched/Modules/HeaderDoc: ParserState.pm.orig Only in headerdoc-8.8.38-patched/Modules/HeaderDoc: ParserState.pm.rej diff -ru headerdoc-8.8.38/Modules/HeaderDoc/PerfEngine.pm headerdoc-8.8.38-patched/Modules/HeaderDoc/PerfEngine.pm --- headerdoc-8.8.38/Modules/HeaderDoc/PerfEngine.pm 2011-02-18 19:07:45.000000000 -0800 +++ headerdoc-8.8.38-patched/Modules/HeaderDoc/PerfEngine.pm 2011-12-03 15:50:36.000000000 -0800 @@ -3,7 +3,7 @@ # Class name: PerfEngine # Synopsis: Performance Testing Engine # -# Last Updated: $Date: 2011/02/18 19:02:59 $ +# Last Updated: $Date: 2011/07/07 15:15:10 $ # # Copyright (c) 2005 Apple Computer, Inc. All rights reserved. # @@ -81,7 +81,6 @@ use File::Basename; use strict; use vars qw($VERSION @ISA); -use POSIX qw(strftime); use Carp; @@ -92,7 +91,7 @@ # In the git repository, contains the number of seconds since # January 1, 1970. # */ -$HeaderDoc::PerfEngine::VERSION = '$Revision: 1298084579 $'; +$HeaderDoc::PerfEngine::VERSION = '$Revision: 1310076910 $'; my $perfDebug = 0; diff -ru headerdoc-8.8.38/Modules/HeaderDoc/PerfPoint.pm headerdoc-8.8.38-patched/Modules/HeaderDoc/PerfPoint.pm --- headerdoc-8.8.38/Modules/HeaderDoc/PerfPoint.pm 2011-02-18 19:07:45.000000000 -0800 +++ headerdoc-8.8.38-patched/Modules/HeaderDoc/PerfPoint.pm 2011-12-03 15:50:36.000000000 -0800 @@ -3,7 +3,7 @@ # Class name: PerfPoint # Synopsis: Test Point Object for Performance Testing Engine # -# Last Updated: $Date: 2011/02/18 19:02:59 $ +# Last Updated: $Date: 2011/07/07 15:15:10 $ # # Copyright (c) 2005 Apple Computer, Inc. All rights reserved. # @@ -69,7 +69,6 @@ use File::Basename; use strict; use vars qw($VERSION @ISA); -use POSIX qw(strftime); use Time::HiRes qw( usleep ualarm gettimeofday tv_interval ); use Carp; @@ -81,7 +80,7 @@ # In the git repository, contains the number of seconds since # January 1, 1970. # */ -$HeaderDoc::PerfPoint::VERSION = '$Revision: 1298084579 $'; +$HeaderDoc::PerfPoint::VERSION = '$Revision: 1310076910 $'; my $perfDebug = 1; diff -ru headerdoc-8.8.38/Modules/HeaderDoc/Test.pm headerdoc-8.8.38-patched/Modules/HeaderDoc/Test.pm --- headerdoc-8.8.38/Modules/HeaderDoc/Test.pm 2011-05-19 16:40:59.000000000 -0700 +++ headerdoc-8.8.38-patched/Modules/HeaderDoc/Test.pm 2011-12-03 15:50:36.000000000 -0800 @@ -3,7 +3,7 @@ # Class name: Test # Synopsis: Test Harness # -# Last Updated: $Date: 2011/05/19 13:01:25 $ +# Last Updated: $Date: 2011/08/11 11:14:51 $ # # Copyright (c) 2008 Apple Computer, Inc. All rights reserved. # @@ -143,7 +143,6 @@ use strict; use vars qw($VERSION @ISA); use Cwd; -use POSIX qw(strftime mktime localtime); use Carp qw(cluck); use HeaderDoc::Utilities qw(processTopLevel); use HeaderDoc::BlockParse qw(blockParseOutside blockParse getAndClearCPPHash); @@ -161,7 +160,7 @@ # In the git repository, contains the number of seconds since # January 1, 1970. # */ -$HeaderDoc::Test::VERSION = '$Revision: 1305835285 $'; +$HeaderDoc::Test::VERSION = '$Revision: 1313086491 $'; # /*! # @abstract @@ -608,7 +607,7 @@ $results .= "-=: BLOCKPARSE PARSER STATE KEYS :=-\n"; my @pskeys = sort keys %{$parserState}; foreach my $key (@pskeys) { - if ($key !~ /(pplStack|hollow|lastTreeNode|freezeStack|parsedParamList|braceStack|treeStack|endOfTripleQuoteToken|rollbackState|availabilityNodesArray)/) { + if ($key !~ /(pplStack|hollow|lastTreeNode|freezeStack|parsedParamList|braceStack|treeStack|endOfTripleQuoteToken|rollbackState|availabilityNodesArray|parsedParamAtBrace|parsedParamStateAtBrace)/) { $results .= "\$parserState->{$key} => ".$parserState->{$key}."\n"; } else { my $temp = $parserState->{$key}; @@ -899,6 +898,41 @@ close(WRITEFILE); } +sub writeToPlist { + my $self = shift; + my $filename = shift; + + # print "SELF: $self\n"; + + eval { + require Data::Plist::XMLWriter; + }; + +return; # for now. + + if ($@) { + warn("Not writing property lists because you do not have Data::Plist.\nTo install it, type:\n sudo cpan YAML\n sudo cpan Data::Plist::XMLWriter\n"); + return; + } + + $filename =~ s/\.test$/\.plist/g; + + # my $plist = Data::Plist->new($self); + + my $writer = Data::Plist::XMLWriter->new; + + my %selfhash = %{$self}; + # foreach my $key (keys %selfhash) { + # print STDERR "DATA $key -> ".$selfhash{$key}."\n"; + # } + + my $str = $writer->write(\%selfhash); + open(WRITEFILE, ">$filename") or die("Could not write file \"$filename\"\n"); + print WRITEFILE $str; + close(WRITEFILE); + +} + # sub dbprint_expanded # { # print STDERR "NOT IMPLEMENTED.\n"; diff -ru headerdoc-8.8.38/Modules/HeaderDoc/Utilities.pm headerdoc-8.8.38-patched/Modules/HeaderDoc/Utilities.pm --- headerdoc-8.8.38/Modules/HeaderDoc/Utilities.pm 2011-05-19 16:40:59.000000000 -0700 +++ headerdoc-8.8.38-patched/Modules/HeaderDoc/Utilities.pm 2011-12-03 15:50:36.000000000 -0800 @@ -2,7 +2,7 @@ # Utilities.pm # # Common subroutines -# Last Updated: $Date: 2011/05/17 14:51:53 $ +# Last Updated: $Date: 2011/08/11 10:57:43 $ # # Copyright (c) 1999-2004 Apple Computer, Inc. All rights reserved. # @@ -50,6 +50,8 @@ use strict; use vars qw(@ISA @EXPORT $VERSION); use Carp qw(cluck); +use IPC::Open2; +use IO::Handle; # use HeaderDoc::MacroFilter qw(filterFileString); use Cwd; @@ -73,7 +75,7 @@ # In the git repository, contains the number of seconds since # January 1, 1970. # */ -$HeaderDoc::Utilities::VERSION = '$Revision: 1305669113 $'; +$HeaderDoc::Utilities::VERSION = '$Revision: 1313085463 $'; @ISA = qw(Exporter); @EXPORT = qw(findRelativePath safeName safeNameNoCollide linesFromFile makeAbsolutePath printHash printArray fileNameFromPath folderPathForFile @@ -755,6 +757,11 @@ # @param arrayref # A reference to an array containing the candidate API references # to check. +# @result +# Returns the array ($value, $bogus) containing the +# best value and a flag to indicate whether the conflict is +# solely caused by a function parameter or local variable +# that is local to a different function. # */ sub chooseBestAPIRef { @@ -764,12 +771,15 @@ my $localDebug = 0; + my $bogus = 0; + if ($fromObj) { my $headerName = ""; my $className = ""; my $targetLang = $fromObj->lang(); my $targetSubLang = $fromObj->sublang(); my $apiOwner = $fromObj->apiOwner(); + my $name = $fromObj->apiuidname(); if ($fromObj->isAPIOwner()) { my $class = ref($fromObj) || $fromObj; @@ -798,7 +808,62 @@ $headerName =~ s/\s//sgo; $headerName =~ s/<.*?>//sgo; - # First, look for the one in the current class. + my @newarr = (); + # First, look for the one in the current function or declaration. + foreach my $ref (@arr) { + if ($ref =~ /^\/\/([^\/]+)\/([^\/]+)\/([^\/]+)\/([^\/]+)\/([^\/]+)\/([^\/]+)(\/|$)/) { + my $apple_ref_part = $1; + my $language_part = $2; + my $reftype_part = $3; + my $class_part = $4; + my $owning_symbol_part = $5; + my $symbol_part = $6; + + print STDERR "POINT A: REF: $ref reftype_part: $reftype_part\n" if ($localDebug); + + if ($reftype_part =~ /(functionparam|methodparam|defineparam|enumconstant|functionvar|methodvar|definevar|structfield|typedeffield)/) { + if (($class_part eq $className) && ($owning_symbol_part eq $name)) { + print STDERR "CLASSMATCH OWNERMATCH (($class_part eq $className) && ($owning_symbol_part eq $name))\n" if ($localDebug); + + return ($ref, $bogus); + } + } else { + push(@newarr, $ref); + } + } elsif ($ref =~ /^\/\/([^\/]+)\/([^\/]+)\/([^\/]+)\/([^\/]+)\/([^\/]+)(\/|$)/) { + my $apple_ref_part = $1; + my $language_part = $2; + my $reftype_part = $3; + my $owning_symbol_part = $4; + my $symbol_part = $5; + + print STDERR "POINT B: REF: $ref reftype_part: $reftype_part\n" if ($localDebug); + + if ($reftype_part =~ /(functionparam|methodparam|defineparam|enumconstant|functionvar|methodvar|definevar|structfield|typedeffield)/) { + if (($owning_symbol_part eq $name) && ($className eq "")) { + print STDERR "OWNERMATCH ($owning_symbol_part eq $name)\n" if ($localDebug); + return ($ref, $bogus); + } + } else { + push(@newarr, $ref); + } + } else { + push(@newarr, $ref); + } + } + + @arr = @newarr; + + if ($localDebug) { + print STDERR "BOGOSITY CHECK: scalar(\@newarr) is ".scalar(@newarr)."\n"; + foreach my $item (@newarr) { + print STDERR "BOGOSITY CHECK: $item\n"; + } + } + + if (scalar(@newarr) == 1) { $bogus = 1; } + + # Next, look for the one in the current class. foreach my $ref (@arr) { print STDERR "PASS 1. CHECKING REF: $ref\n" if ($localDebug); if ($ref =~ /^\/\/([^\/]+)\/([^\/]+)\/([^\/]+)\/([^\/]+)\/([^\/]+)(\/|$)/) { @@ -812,7 +877,7 @@ print STDERR "CLASS PART: $class_part TARGET: $className\n" if ($localDebug); if ($language_part eq $targetLang || $language_part eq $targetSubLang) { - if ($class_part eq $className) { return $ref; } + if ($class_part eq $className) { return ($ref, $bogus); } } } } @@ -831,7 +896,7 @@ print STDERR "HEADER PART: $class_part TARGET: $headerName\n" if ($localDebug); if ($language_part eq $targetLang || $language_part eq $targetSubLang) { - if ($class_part eq $headerName) { return $ref; } + if ($class_part eq $headerName) { return ($ref, $bogus); } } } } @@ -857,7 +922,7 @@ if ($toObj->filename() eq $fromObj->filename()) { - return $ref; + return ($ref, $bogus); } } elsif (!$toObj) { warn("No object found for UID $ref\n"); @@ -865,7 +930,7 @@ } } - return $arr[0]; + return ($arr[0], $bogus); } # /*! @@ -905,10 +970,14 @@ $ret = $uid; if ($uid_conflict{$symbol}) { my @candidates = @{$uid_candidates{$symbol}}; - $uid = chooseBestAPIRef($fromObj, $uid_candidates{$symbol}); + my $conflict_is_bogus; + ($uid, $conflict_is_bogus) = chooseBestAPIRef($fromObj, $uid_candidates{$symbol}); $ret = $uid; # foreach my $x (@candidates) { print STDERR "CANDIDATE $x\n"; } - warn "$fullpath:0: warning: multiple matches found for symbol \"$symbol\"!!! Only the nearest matching symbol will be $linkedword. Replace the symbol with a specific api ref tag (e.g. apple_ref) in header file to fix this conflict.\n\nCandidates are:\n\t".join("\n\t", @candidates)."\n\nDefault is:\n\t$uid\n"; + + if (!$conflict_is_bogus) { + warn "$fullpath:0: warning: multiple matches found for symbol \"$symbol\"!!! Only the nearest matching symbol will be $linkedword. Replace the symbol with a specific api ref tag (e.g. apple_ref) in header file to fix this conflict.\n\nCandidates are:\n\t".join("\n\t", @candidates)."\n\nDefault is:\n\t$uid\n"; + } } } if ($ret eq "") { @@ -1330,6 +1399,40 @@ # #define macros to be parsed from the code. This is # only used for code parsing, NOT for interpreting # the actual #define macros themselves! +# @var regexpfirstcharpattern +# A regular expression that matches any symbol that is a +# legal start token for a regular expression. In Perl, +# there are a lot of these. In Ruby and JavaScript, only +# slash (/) is allowed. In Tcl, only a left curly brace +# is allowed (because other regular expressions are just +# strings). +# @var regexpcharpattern +# A regular expression containing a list of tokens that +# are special in regular expressions. In general, only +# start tokens are listed, with the exception of the close +# curly brace. This should probably be the same for every +# language that supports regular expressions. +# @var regexppattern +# A list of special Perl commands that are immediately +# followed by a regular expression (e.g. tr). +# @var singleregexppattern +# A list of special Perl commands that are immediately +# followed by a one-part regular expression (e.g. qq). +# This is a strict subset of {@link regexppattern}. +# @var regexpAllowedAfter +# A list of symbols that a regular expression can +# follow. This prevents other uses of certain common +# symbol (e.g. /) from incorrectly triggering the start +# of regular expression parsing. +# @var regexpAllowedAtStartOfLine +# Set to 1 in languages where regular expressions are +# first-class objects (Ruby) and thus can legally appear +# as the first symbol on a line in addition to places that +# can be detected based on the previous symbol. +# @var TCLregexpcommand +# Set to "regexp" in Tcl. This is a regular expression +# that matches a list of commands in scripting languages +# that can take an unquoted (non-string) regular expression. # */ sub parseTokens { @@ -1429,7 +1532,7 @@ # curly braces in TCL. $parseTokens{parmswithcurlybraces} = 1; $parseTokens{superclasseswithcurlybraces} = 1; - $parseTokens{classregexp} = "^(Class)\$"; + $parseTokens{classregexp} = "^(class)\$"; $parseTokens{varname} = "attribute"; } if ($lang eq "shell" && $sublang eq "csh") { @@ -1440,6 +1543,30 @@ } $parseTokens{constname} = ""; $parseTokens{structisbrace} = 0; + + if ($lang eq "perl") { + $parseTokens{regexpAllowedAfter} = '(\~|\(|\=|\,)'; + + $parseTokens{regexpcharpattern} = "[[|{}#(/'\"<`]"; + # "}" vi bug workaround for previous line + + # If it appears not after a ~, tr, etc., only allow slash. + $parseTokens{regexpfirstcharpattern} = "[/]"; + # "}" vi bug workaround for previous line + + $parseTokens{regexppattern} = "qq|qr|qx|qw|q|m|s|tr|y"; + $parseTokens{singleregexppattern} = "qq|qr|qx|qw|q|m"; + + } elsif ($lang eq "tcl") { + # Syntax: regexp [-foo [-bar ..]] {expression goes here} ... + $parseTokens{TCLregexpcommand} = "regexp"; + + $parseTokens{regexpfirstcharpattern} = "[{]"; + # "}" vi bug workaround for previous line + + $parseTokens{regexpcharpattern} = "[[|{}#(/'\"<`]"; + # "}" vi bug workaround for previous line + } } elsif ($lang eq "pascal") { print STDERR "Language is Pascal.\n" if ($langDebug); $parseTokens{sotemplate} = ""; @@ -1508,6 +1635,15 @@ $parseTokens{structisbrace} = 0; $parseTokens{functionisbrace} = 1; $parseTokens{classisbrace} = 1; + + $parseTokens{regexpAllowedAfter} = '(\~|\(|\=|\,|if|elsif|while|unless|until|when)'; + $parseTokens{regexpAllowedAtStartOfLine} = 1; + + $parseTokens{regexpfirstcharpattern} = "[/]"; + # "}" vi bug workaround for previous line + $parseTokens{regexpcharpattern} = "[[|{}#(/'\"<`]"; + # "}" vi bug workaround for previous line + } elsif ($lang eq "applescript") { # Applescript $parseTokens{classregexp} = "^(script)\$"; @@ -1524,13 +1660,14 @@ # $parseTokens{lbrace} = "{"; $parseTokens{lbraceunconditionalre} = "^(tell)"; $parseTokens{rbrace} = "end"; + $parseTokens{rbracetakesargument} = 1; $parseTokens{varname} = "property"; # $parseTokens{constname} = "const"; $parseTokens{structisbrace} = 0; $parseTokens{functionisbrace} = 1; $parseTokens{classisbrace} = 1; $parseTokens{assignmentwithcolon} = 1; - $parseTokens{labelregexp} = "^(about|above|against|apart from|around|aside from|at|below|beneath|beside|between|by|for|from|instead of|into|on|onto|out of|over|since|thru|through|under)"; + $parseTokens{labelregexp} = "^(about|above|against|apart from|around|aside from|at|below|beneath|beside|between|by|for|from|instead of|into|on|onto|out of|over|since|thru|through|under)\$"; $parseTokens{sofunction} = "on"; @@ -1588,6 +1725,15 @@ $parseTokens{accessregexp} = "^(public|private|protected)\$"; $parseTokens{ilc_b} = "#"; } + if ($lang eq "java" && $sublang eq "javascript") { + $parseTokens{regexpAllowedAfter} = '(\(|\=|\,)'; + + $parseTokens{regexpcharpattern} = "[[|{}#(/'\"<`]"; + # "}" vi bug workaround for previous line + $parseTokens{regexpfirstcharpattern} = '[/]'; + # "}" vi bug workaround for previous line + + } $parseTokens{soc} = "/*"; $parseTokens{eoc} = "*/"; @@ -1695,9 +1841,9 @@ } -use FileHandle; -use IPC::Open2; -use Fcntl; +# use FileHandle; +# use IPC::Open2; +# use Fcntl; # /*! @group XML Helpers # @abstract @@ -2849,6 +2995,7 @@ ($classBPtype =~ /typedef/) && do { return "C"; }; ($classBPtype =~ /struct/) && do { return "C"; }; ($classBPtype =~ /class/) && do { return $sublang; }; + ($classBPtype =~ /script/) && do { return $sublang; }; ($classBPtype =~ /interface/) && do { return $sublang; }; ($classBPtype =~ /implementation/) && do { return $sublang; }; ($classBPtype =~ /module/) && do { return $sublang; }; @@ -2980,7 +3127,7 @@ my $os = ""; if ($string =~ s/^__IPHONE_//) { - $os = "iPhone OS"; + $os = "iOS"; } elsif ($string =~ s/^__MAC_//) { $os = "Mac OS X"; } else { Only in headerdoc-8.8.38-patched: b diff -ru headerdoc-8.8.38/headerDoc2HTML.pl headerdoc-8.8.38-patched/headerDoc2HTML.pl --- headerdoc-8.8.38/headerDoc2HTML.pl 2011-05-06 20:31:21.000000000 -0700 +++ headerdoc-8.8.38-patched/headerDoc2HTML.pl 2011-12-03 15:50:36.000000000 -0800 @@ -4,7 +4,7 @@ # Synopsis: Scans a file for headerDoc comments and generates an HTML # file from the comments it finds. # -# Last Updated: $Date: 2011/05/06 20:29:05 $ +# Last Updated: $Date: 2011/07/07 15:15:10 $ # # ObjC additions by SKoT McDonald Aug 2001 # @@ -29,7 +29,7 @@ # # @APPLE_LICENSE_HEADER_END@ # -# $Revision: 1304738945 $ +# $Revision: 1310076910 $ ##################################################################### @@ -61,7 +61,7 @@ # In the git repository, contains the number of seconds since # January 1, 1970. # */ -my $VERSION = '$Revision: 1304738945 $'; +my $VERSION = '$Revision: 1310076910 $'; # /*! # @abstract @@ -3062,6 +3062,7 @@ print STDERR "$fullpath:$linenum: warning: Couldn't find Header object that owns the category with name $categoryName.\n"; } my $assocapio = $associatedClass->APIOwner(); + $assocapio->resetAppleRefUsed(); if ($man_output) { $assocapio->writeHeaderElementsToManPage(); } elsif ($function_list_output) { @@ -4404,7 +4405,8 @@ exit(-1); } } - $test->writeToFile("$filename"); + $test->writeToFile($filename); + $test->writeToPlist($filename); print "Wrote test data to \"$filename\"\n"; $test->dbprint(); } @@ -4563,6 +4565,12 @@ } my $test = HeaderDoc::Test->new(); $test->readFromFile($filename); + + my $plist = $filename; + $plist =~ s/\.test$/\.plist/g; + if (! -f $plist) { + $test->writeToPlist($filename); + } print "Test \"".$test->{NAME}."\": "; my $coretestfail = $test->runTest(\@ignore_re); @@ -4583,6 +4591,7 @@ $test->{EXPECTED_RESULT} = $test->{RESULT}; $test->{EXPECTED_RESULT_ALLDECS} = $test->{RESULT_ALLDECS}; $test->writeToFile($filename); + $test->writeToPlist($filename); $ok_count++; } elsif (($test->{FILTERED_RESULT} eq $test->{EXPECTED_FILTERED_RESULT}) && ($test->{FILTERED_RESULT_ALLDECS} eq $test->{EXPECTED_FILTERED_RESULT_ALLDECS})) { @@ -4595,6 +4604,7 @@ if ($force) { $test->writeToFile($filename); + $test->writeToPlist($filename); } # $test->showresults(); @@ -4651,6 +4661,7 @@ $test->{EXPECTED_RESULT} = $test->{RESULT}; $test->{EXPECTED_RESULT_ALLDECS} = $test->{RESULT_ALLDECS}; $test->writeToFile($filename); + $test->writeToPlist($filename); $ok_count++; $continue_update = 0; } elsif ($temp =~ /^\s*skip\s*$/) { $fail_count++; $continue_update = 0; @@ -4669,6 +4680,7 @@ $test->{EXPECTED_RESULT} = $test->{RESULT}; $test->{EXPECTED_RESULT_ALLDECS} = $test->{RESULT_ALLDECS}; $test->writeToFile($filename); + $test->writeToPlist($filename); $ok_count++; $continue_update = 0; } else { print STDERR "Still failed. (At some point, re-running a test will work, but not yet.)\n"; diff -ru headerdoc-8.8.38/processFramework.sh headerdoc-8.8.38-patched/processFramework.sh --- headerdoc-8.8.38/processFramework.sh 2011-05-06 20:08:47.000000000 -0700 +++ headerdoc-8.8.38-patched/processFramework.sh 2011-12-03 15:50:36.000000000 -0800 @@ -41,7 +41,7 @@ fi ASK=0 -if [ "x$1" = "x-q" ] ; then +if [ "x$1" = "x-q" -o "x$1" = "x-i" ] ; then ASK=1 shift fi