upvar$elements_var elements
if { [info exists elements] } {
unset elements
}
set lines [split$doc_string"\n\r"]
array set elements [list]
set current_element main
set buffer ""foreach line $lines {
# lars@pinds.com, 8 July, 2000# We don't do a string trim anymore, because it breaks the formatting of# code examples in the documentation, something that we want to encourage.# set line [string trim $line]if { [regexp {^[ \t]*@([-a-zA-Z_]+)(.*)$} $line"" element remainder] } {
lappend elements($current_element) [string trim $buffer]
set current_element $elementset buffer "$remainder\n"
} else {
append buffer $line"\n"
}
}
lappend elements($current_element) [string trim $buffer]