Ticket #6831: makeCix_updates.patch

File makeCix_updates.patch, 5.0 kB (added by dante, 8 months ago)

patch courtesy Todd Whiteman [ActiveState?]

  • util/docscripts/makeCix.php

     
    3434$doc = new DOMDocument('1.0'); 
    3535// setup for codeintel: 
    3636$codeintel = $doc->createElement('codeintel'); 
    37 $codeintel->setAttribute("description","the Dojo Toolkit 1.1 API"); 
     37$codeintel->setAttribute("description","Dojo Toolkit API - version 1.1.1"); 
    3838$codeintel->setAttribute("version","2.0"); 
    3939$codeintel->setAttribute("encoding","UTF-8"); 
    4040// wrap all the api in one "file" tag: 
     
    6666                                switch($tt){ 
    6767                                        case "Object" : 
    6868                                                // inspect this object deeper, but append to namespace: 
    69                                                 $nsdata->appendChild(dojo_inspect($data[$obj],$obj,$doc)); 
     69                                                $nsdata->appendChild(dojo_inspect($data[$obj],$obj,$doc, "variable")); 
    7070                                                break; 
    7171                                        case "Function" : 
    7272                                                if($info['classlike']){ 
     
    130130 
    131131function dojo_inspect($data,$ns,$doc,$t="scope"){ 
    132132        // summary: inspect some namespace (as top), with some passed data. 
    133          
    134         $elm = $doc->createElement($t); 
     133        if ($t == "argument") { 
     134                $elm = $doc->createElement("variable"); 
     135                $elm->setAttribute("ilk", "argument"); 
     136        } else { 
     137                $elm = $doc->createElement($t); 
     138        } 
    135139        $elm->setAttribute("name",$ns); 
    136140 
    137         if($t=="variable"){ $elm->setAttribute("ilk",argument); } 
    138          
    139141        foreach ($data as $obj => $info){ 
    140142                switch($obj){ 
    141143                        // these are all the ones we don't _really_ care about in this context: 
     
    157159                                $sig = $ns."("; 
    158160                                foreach($info as $key => $val){ 
    159161                                        $sig .= $key.","; 
    160                                         $elm->appendChild(dojo_inspect($val,$key,$doc,"variable")); 
     162                                        $elm->appendChild(dojo_inspect($val,$key,$doc,"argument")); 
    161163                                } 
    162164                                $sig = substr($sig,0,strlen($sig)-1); 
    163165                                $sig .= ")"; 
     
    169171                        case "private" : $elm->setAttribute("attributes","private"); break; 
    170172 
    171173                        case "type" : 
    172                                 if($info){ $elm->setAttribute("citdl",$info); } 
    173                                 switch ($info){ 
    174                                         case "Object" : 
    175                                                 //$elm->appendChild(dojo_inspect($info,$obj,$doc,"variable")); 
    176                                                 break; 
     174                                if($info) { 
     175                                        switch ($info){ 
     176                                                case "Function" : 
     177                                                        $elm->setAttribute("ilk","function"); 
     178                                                        break; 
     179                                                default: 
     180                                                        $elm->setAttribute("citdl",$info); 
     181                                                        break; 
     182                                        } 
    177183                                } 
    178184                                break; 
    179185 
     
    182188                                break; 
    183189 
    184190                        // just in case we missed something? 
    185                         default : $elm->appendChild(dojo_inspect($data[$obj],$obj,$doc,"scope")); break; 
     191                        default : 
     192                                $scope_type = "scope"; 
     193                                if (($data[$obj]["instance"] != NULL) || 
     194                                    ($data[$obj]["type"] == "Object")) { 
     195                                        $scope_type = "variable"; 
     196                                } 
     197                                $elm->appendChild(dojo_inspect($data[$obj],$obj,$doc,$scope_type)); 
     198                                break; 
    186199                } 
    187200        } 
    188201        // give it back as a domNode: 
     
    236249                                        if(!($list[0]==$namespace)){ continue; } 
    237250                                        switch($n){ 
    238251                                                case 8 : 
    239                                                         // print "UNCAUGHT! ".$item; // way tooooo deep. 
     252                                                        fprintf("UNCAUGHT! %s", $item); // way tooooo deep. 
    240253                                                        break; 
    241254                                                case 7 :  
    242255                                                        $l1 = $list[1]; 
     
    245258                                                        $l4 = $list[4]; 
    246259                                                        $l5 = $list[5]; 
    247260                                                        $l6 = $list[6]; 
    248                                                         $ret[$namespace][$l1][$l2][$l3][$l4][$l5][$l6] = $data; 
     261                                                        if ($ret[$namespace][$l1][$l2][$l3][$l4][$l5][$l6] == NULL) 
     262                                                                $ret[$namespace][$l1][$l2][$l3][$l4][$l5][$l6] = $data; 
     263                                                        else 
     264                                                                $ret[$namespace][$l1][$l2][$l3][$l4][$l5][$l6] = array_merge_recursive($data, $ret[$namespace][$l1][$l2][$l3][$l4][$l5][$l6]); 
    249265                                                        break; 
    250266                                                case 6 : 
    251267                                                        $l1 = $list[1]; 
     
    253269                                                        $l3 = $list[3]; 
    254270                                                        $l4 = $list[4]; 
    255271                                                        $l5 = $list[5]; 
    256                                                         $ret[$namespace][$l1][$l2][$l3][$l4][$l5] = $data; 
     272                                                        if ($ret[$namespace][$l1][$l2][$l3][$l4][$l5] == NULL) 
     273                                                                $ret[$namespace][$l1][$l2][$l3][$l4][$l5] = $data; 
     274                                                        else 
     275                                                                $ret[$namespace][$l1][$l2][$l3][$l4][$l5] = array_merge_recursive($data, $ret[$namespace][$l1][$l2][$l3][$l4][$l5]); 
    257276                                                        break; 
    258277                                                case 5 :  
    259278                                                        $l1 = $list[1]; 
    260279                                                        $l2 = $list[2]; 
    261280                                                        $l3 = $list[3]; 
    262281                                                        $l4 = $list[4]; 
    263                                                         $ret[$namespace][$l1][$l2][$l3][$l4] = $data; 
     282                                                        if ($ret[$namespace][$l1][$l2][$l3][$l4] == NULL) 
     283                                                                $ret[$namespace][$l1][$l2][$l3][$l4] = $data; 
     284                                                        else 
     285                                                                $ret[$namespace][$l1][$l2][$l3][$l4] = array_merge_recursive($data, $ret[$namespace][$l1][$l2][$l3][$l4]); 
    264286                                                        break; 
    265287                                                case 4 : 
    266288                                                        $l1 = $list[1]; 
    267289                                                        $l2 = $list[2]; 
    268290                                                        $l3 = $list[3]; 
    269                                                         $ret[$namespace][$l1][$l2][$l3] = $data; 
     291                                                        if ($ret[$namespace][$l1][$l2][$l3] == NULL) 
     292                                                                $ret[$namespace][$l1][$l2][$l3] = $data; 
     293                                                        else 
     294                                                                $ret[$namespace][$l1][$l2][$l3] = array_merge_recursive($data, $ret[$namespace][$l1][$l2][$l3]); 
    270295                                                        break; 
    271296                                                case 3 : 
    272297                                                        $l1 = $list[1]; 
    273298                                                        $l2 = $list[2]; 
    274                                                         $ret[$namespace][$l1][$l2] = $data; 
     299                                                         
     300                                                        if ($ret[$namespace][$l1][$l2] == NULL) 
     301                                                                $ret[$namespace][$l1][$l2] = $data; 
     302                                                        else 
     303                                                                $ret[$namespace][$l1][$l2] = array_merge_recursive($data, $ret[$namespace][$l1][$l2]); 
    275304                                                        break; 
    276305                                                case 2 : 
    277306                                                        $l1 = $list[1];