Index: openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl,v diff -u -r1.30.2.19 -r1.30.2.20 --- openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl 14 Feb 2016 11:20:14 -0000 1.30.2.19 +++ openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl 24 Feb 2016 09:07:12 -0000 1.30.2.20 @@ -1288,25 +1288,47 @@ if {$endPos > -1} { set line0 [string range $data $i $endPos] set line [string trim $line0] - if {[string range $line end end] eq "\{" - && [llength [string range $line 0 end-1]] == 3} { - set comment_start [expr {[string last "\{" $line] + $i}] - set comment_end [expr {$comment_start + 1}] - while {![info complete [string range $data $comment_start $comment_end]] && $comment_end < $l} { - incr comment_end + # + # Does the line end with a open brace? + # + if {[string range $line end end] eq "\{"} { + # Do we have a signature of an + # ad_proc (ad_proc ?-options ...? + # name args) before that? + # + # Note, that this handles just + # single line ad-proc signatures, + # not multi-line argument lists. + + set start [string range $line 0 end-1] + set elements 3 + for {set idx 1} {[string range [lindex $start $idx] 0 0] eq "-"} {incr idx} { + incr elements } - if {$comment_end < $l} { - ns_log notice "AD_PROC CAND COMM [string range $data $comment_start $comment_end]" - set url "" - append html \ - "" \ - [pretty_token proc ad_proc] \ - [string range $data $i+7 $comment_start] \ - "" \ - [string range $data $comment_start+1 $comment_end-1] \ - "\}" - set i $comment_end - continue + + if {[llength $start] == $elements} { + # + # Read next lines until brace is balanced. + # + set comment_start [expr {[string last "\{" $line] + $i}] + set comment_end [expr {$comment_start + 1}] + while {![info complete [string range $data $comment_start $comment_end]] + && $comment_end < $l} { + incr comment_end + } + if {$comment_end < $l} { + ns_log notice "AD_PROC CAND COMM [string range $data $comment_start $comment_end]" + set url "" + append html \ + "" \ + [pretty_token proc ad_proc] \ + [string range $data $i+7 $comment_start] \ + "" \ + [string range $data $comment_start+1 $comment_end-1] \ + "\}" + set i $comment_end + continue + } } } }