Index: library/lib/doc-tools.xotcl
===================================================================
diff -u -r783648c4c7132adc4a447faa69d6e4e12b621c46 -rbb58b68431fe35dd6ff16e69044705e1246d0dda
--- library/lib/doc-tools.xotcl (.../doc-tools.xotcl) (revision 783648c4c7132adc4a447faa69d6e4e12b621c46)
+++ library/lib/doc-tools.xotcl (.../doc-tools.xotcl) (revision bb58b68431fe35dd6ff16e69044705e1246d0dda)
@@ -466,6 +466,19 @@
:attribute @subcommand -slotclass ::nx::doc::PartAttribute {
set :part_class @subcommand
}
+ :method parameters {} {
+ set params [list]
+ if {[info exists :@param]} {
+ foreach p [:@param] {
+ set value [$p name]
+ if {[$p exists default] || [$p name] eq "args" } {
+ set value "?[$p name]?"
+ }
+ lappend params $value
+ }
+ }
+ return $params
+ }
}
EntityClass create @object \
@@ -627,7 +640,7 @@
#
# @param partof Refers to the entity object which contains this part
# @param name Stores the name of the documented parameter
- # @modifier private
+ # @modifier protected
set partof_fragment [:get_unqualified_name ${partof}]
return [:root_namespace]::${:tag}::${partof_fragment}::${name}
@@ -803,10 +816,13 @@
set id [$entity_type id {*}$args]
if {![::nx::core::is $id object]} return;
set pof ""
- if {[$id info is type ::nx::core::Part]} {
+ if {[$id info is type ::nx::doc::Part]} {
set pof "[[$id partof] name]#"
+ set filename [[$id partof] filename]
+ } else {
+ set filename [$id filename]
}
- return "$pof[$id name]"
+ return "$pof[$id name]"
}
:method text {} {
@@ -974,7 +990,7 @@
# b. intrinsic: 'thing' is a arbitrary string block describing
# a script.
#
- :method process {thing args} {
+ :method process {{-noeval false} thing args} {
# 1) in-situ processing: a class object
if {[::nx::core::objectproperty $thing object]} {
if {[$thing exists __initcmd]} {
@@ -1022,7 +1038,8 @@
:log "error reading the file '$thing', i.e.: '$msg'"
}
close $fh
- doc analyze $script {*}$args
+ doc analyze -noeval $noeval $script {*}$args
+ #doc process -noeval $noeval $script {*}$args
} else {
:log "file '$thing' not readable"
}
@@ -1032,27 +1049,29 @@
set cmd [subst {
package req next::doc
namespace import -force ::nx::doc::*
- doc analyze [list $thing]
+ doc analyze -noeval $noeval [list $thing]
}]
interp eval $i $cmd
#interp delete $i
return $i
}
}
- :method analyze {script additions:optional} {
+ :method analyze {{-noeval false} script {additions ""}} {
# NOTE: This method is to be executed in a child/ slave
# interpreter.
- uplevel #0 [list namespace import -force ::nx::doc::*]
- set pre_commands [:list_commands]
- uplevel #0 [list eval $script]
- set post_commands [:list_commands]
- if {![info exists additions]} {
- set additions [dict keys [dict remove [dict create {*}"[join $post_commands " _ "] _"] {*}$pre_commands]]
- } else {
- set additions [dict keys [dict get $additions objects]]
+ if {!$noeval} {
+ uplevel #0 [list namespace import -force ::nx::doc::*]
+ set pre_commands [:list_commands]
+ uplevel #0 [list eval $script]
+ set post_commands [:list_commands]
+ if {$additions eq ""} {
+ set additions [dict keys [dict remove [dict create {*}"[join $post_commands " _ "] _"] {*}$pre_commands]]
+ } else {
+ set additions [dict keys [dict get $additions objects]]
+ }
+ # puts stderr ADDITIONS=$additions
}
- puts stderr ADDITIONS=$additions
set blocks [:comment_blocks $script]
# :log "blocks: '$blocks'"
# 1) eval the script in a dedicated interp; provide for
@@ -1330,7 +1349,7 @@
}
if {$failure ne ""} {
- puts stderr ERRORINFO=$::errorInfo
+ #puts stderr ERRORINFO=$::errorInfo
error $failure
}
@@ -1401,7 +1420,6 @@
The entity type '$tag' is not available
}]] throw
}
- puts stderr "$tag new -name $nq_name {*}$args"
set :current_entity [$tag new -name $nq_name {*}$args]
}
} else {