cvs: phpdoc /dsssl common.dsl.in html-common.dsl print.dsl.in

From: Date: Thu, 19 Jun 2003 15:56:31 +0000
Subject: cvs: phpdoc /dsssl common.dsl.in html-common.dsl print.dsl.in
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969354624@lists.php.net to get a copy of this message
hholzgra Thu Jun 19 11:56:31 2003 EDT Modified files: /phpdoc/dsssl common.dsl.in html-common.dsl print.dsl.in Log: duplicate prototype related code moved to common.dsl support for parameters with default values given using the <initialize> tag within <methodparam> Index: phpdoc/dsssl/common.dsl.in diff -u phpdoc/dsssl/common.dsl.in:1.6 phpdoc/dsssl/common.dsl.in:1.7 --- phpdoc/dsssl/common.dsl.in:1.6 Tue Apr 29 03:11:59 2003 +++ phpdoc/dsssl/common.dsl.in Thu Jun 19 11:56:31 2003 @@ -1,6 +1,6 @@ ;; -*- Scheme -*- ;; -;; $Id: common.dsl.in,v 1.6 2003/04/29 07:11:59 moriyoshi Exp $ +;; $Id: common.dsl.in,v 1.7 2003/06/19 15:56:31 hholzgra Exp $ ;; ;; This file contains stylesheet customization common to the HTML ;; and print versions. @@ -83,7 +83,7 @@ (normalize "authorgroup") (normalize "author") (normalize "editor") - (normalize "pubdate") + (normalize "pubdate") (normalize "copyright") (normalize "abstract") (normalize "legalnotice"))) @@ -100,18 +100,56 @@ (if (node-list-empty? nl) (empty-sosofo) ;; empty list -> do nothing (make sequence ;; process list node - (if (attribute-string (normalize "choice") (node-list-first nl)) - (if (string=? "opt" (attribute-string (normalize "choice") (node-list-first nl))) + (if (or (and (attribute-string (normalize "choice") (node-list-first nl)) + (string=? "opt" (attribute-string (normalize "choice") (node-list-first nl))) + ) + (has-default-value (node-list-first nl))) (literal %arg-choice-opt-close-str%) ;; is optional parameter -> close a bracket (empty-sosofo) ) - (empty-sosofo) - ) (methodsynopsis-generate-closing-optionals (node-list-rest nl)) ;; process rest of list ) ) ) - + +(define (is-true-optional nl) + (and (equal? (gi (parent nl)) (normalize "parameter")) + (equal? 0 (string-length (strip (data (preced nl))))) + (equal? 0 (string-length (strip (data (follow nl))))) + ) + ) + + +(define (has-true-optional nl) + (is-true-optional + (node-list-first-element + (select-elements + (descendants nl) + (normalize "optional")) + ) + ) + ) + + +(define (count-true-optionals nl) + (let loop + ((result 0) + (nl (select-elements (descendants nl) (normalize "optional"))) + ) + (if(node-list-empty? nl) + result + (if(is-true-optional(node-list-first nl)) + (loop (+ result 1) (node-list-rest nl)) + (loop result (node-list-rest nl)) + ) + ) + ) + ) + +(define (has-default-value nl) + (not (node-list-empty? ( select-elements (descendants nl) (normalize "initializer")))) + ) + ;; render methodsynopsis (element methodsynopsis (make sequence @@ -146,8 +184,10 @@ ;; special case -> first parameter is optional (if (equal? (gi (ipreced (current-node))) (normalize "methodparam")) (empty-sosofo) ;; have prev. parameters -> is not first - (if (equal? (attribute-string (normalize "choice")) "opt") - (literal %arg-choice-opt-open-str%) ;; generate opening bracket + (if (or (equal? (attribute-string (normalize "choice")) "opt") + (has-default-value (current-node)) + ) + (literal %arg-choice-opt-open-str%) ;; generate opening bracket (empty-sosofo) ) ) @@ -158,7 +198,9 @@ (if (equal? (gi (ifollow (current-node))) (normalize "methodparam")) (make sequence ;; is next parameter optional? - (if (equal? (attribute-string (normalize "choice") (ifollow (current-node))) "opt") + (if (or (equal? (attribute-string (normalize "choice") (ifollow (current-node))) "opt") + (has-default-value (ifollow (current-node))) + ) (make sequence (literal " ") (literal %arg-choice-opt-open-str%) @@ -173,8 +215,9 @@ ) ) +;; special "void" return type tag (element (methodsynopsis void) - (literal "void") + (literal "void ") ) @@ -192,4 +235,13 @@ (process-children-trim) ) ) + +;; render default value +(element (methodparam initializer) + (make sequence + (literal "=") + ($italic-seq$ (process-children-trim)) + ) + ) + Index: phpdoc/dsssl/html-common.dsl diff -u phpdoc/dsssl/html-common.dsl:1.11 phpdoc/dsssl/html-common.dsl:1.12 --- phpdoc/dsssl/html-common.dsl:1.11 Thu Feb 20 04:28:02 2003 +++ phpdoc/dsssl/html-common.dsl Thu Jun 19 11:56:31 2003 @@ -1,6 +1,6 @@ ;; -*- Scheme -*- ;; -;; $Id: html-common.dsl,v 1.11 2003/02/20 09:28:02 philip Exp $ +;; $Id: html-common.dsl,v 1.12 2003/06/19 15:56:31 hholzgra Exp $ ;; ;; Returns the depth of the auto-generated TOC (table of @@ -31,41 +31,6 @@ ) -(define (is-true-optional nl) - (and (equal? (gi (parent nl)) (normalize "parameter")) - (equal? 0 (string-length (strip (data (preced nl))))) - (equal? 0 (string-length (strip (data (follow nl))))) - ) - ) - - -(define (has-true-optional nl) - (is-true-optional - (node-list-first-element - (select-elements - (descendants nl) - (normalize "optional")) - ) - ) - ) - - -(define (count-true-optionals nl) - (let loop - ((result 0) - (nl (select-elements (descendants nl) (normalize "optional"))) - ) - (if(node-list-empty? nl) - result - (if(is-true-optional(node-list-first nl)) - (loop (+ result 1) (node-list-rest nl)) - (loop result (node-list-rest nl)) - ) - ) - ) - ) - - ;; There are two different kinds of optionals ;; optional parameters and optional parameter parts. ;; An optional parameter is identified by an optional tag @@ -363,6 +328,7 @@ (process-children) ) ) + ;; Display of question tags, link targets (element question Index: phpdoc/dsssl/print.dsl.in diff -u phpdoc/dsssl/print.dsl.in:1.3 phpdoc/dsssl/print.dsl.in:1.4 --- phpdoc/dsssl/print.dsl.in:1.3 Thu Mar 14 07:07:39 2002 +++ phpdoc/dsssl/print.dsl.in Thu Jun 19 11:56:31 2003 @@ -7,7 +7,7 @@ <!-- - $Id: print.dsl.in,v 1.3 2002/03/14 12:07:39 hholzgra Exp $ + $Id: print.dsl.in,v 1.4 2003/06/19 15:56:31 hholzgra Exp $ This file contains printout-specific stylesheet customization. @@ -190,39 +190,6 @@ ;; an optional parameter is identified by an optional tag ;; with a parameter tag as its parent ;; and only whitespace between them -(define (is-true-optional nl) - (and (equal? (gi (parent nl)) (normalize "parameter")) - (equal? 0 (string-length (strip (data (preced nl))))) - (equal? 0 (string-length (strip (data (follow nl))))) - ) - ) - -(define (has-true-optional nl) - (is-true-optional - (node-list-first-element - (select-elements - (descendants nl) - (normalize "optional")) - ) - ) - ) - - -(define (count-true-optionals nl) - (let loop - ((result 0) - (nl (select-elements (descendants nl) (normalize "optional"))) - ) - (if(node-list-empty? nl) - result - (if(is-true-optional(node-list-first nl)) - (loop (+ result 1) (node-list-rest nl)) - (loop result (node-list-rest nl)) - ) - ) - ) - ) - (element optional ;;check for true optional parameter

« previous php.doc (#969354624) next »