xo::api proc get_doc_block (public)
xo::api get_doc_block text [ restVar ]
Defined in packages/xotcl-core/tcl/01-debug-procs.tcl
Get the (first) documentation block of the provided text (which might be e.g. the body of a method).
- Parameters:
- text (required)
- restVar (optional)
- Testcases:
- No testcase defined.
Source code: # # Get the (first) documentation block of the provided text (which # might be e.g. the body of a method). # set lines [split $text \n] set docBlock "" set i 0 set nrLines [llength $lines] while {[string is space [lindex $lines $i]] && $i < $nrLines} {incr i} while {$i < $nrLines} { set line [string trim [lindex $lines $i]] incr i if {[string index $line 0] ne "#"} break append docBlock [string range $line 1 end] \n } if {$restVar ne ""} { upvar $restVar rest set rest [join [lrange $lines $i-1 end] \n] } #ns_log notice "=================== get_doc_block RETURNS <$docBlock>" return $docBlockXQL Not present: Generic, PostgreSQL, Oracle