Index: library/lib/doc-assets/@class.html.yuidoc =================================================================== diff -u -rbbf48b80f31cfe50ba2114cf0ec6f1465b60c2e1 -r111bc97fb2853629b153839d2b1f3542f8b50a75 --- library/lib/doc-assets/@class.html.yuidoc (.../@class.html.yuidoc) (revision bbf48b80f31cfe50ba2114cf0ec6f1465b60c2e1) +++ library/lib/doc-assets/@class.html.yuidoc (.../@class.html.yuidoc) (revision 111bc97fb2853629b153839d2b1f3542f8b50a75) @@ -11,6 +11,14 @@ }] +
+ ${:name}
+ create
+ obj
+ [:pinfo get -default "" bundle parametersyntax]
+
+[:? {[info exists :@return] && [${:@return} spec] ne ""} {<[${:@return} spec]>} ]
+ [:? {[info exists :@return] && [${:@return} @spec] ne ""} {<[${:@return} @spec]>} ]
${:name}
[:pinfo get -default "" bundle parametersyntax]
@@ -37,7 +37,7 @@
[$sub print_name]
- [:? {[$sub eval {info exists :@return}] && [[$sub @return] spec] ne ""} {<[[$sub @return] spec]>} ]
+ [:? {[$sub eval {info exists :@return}] && [[$sub @return] @spec] ne ""} {<[[$sub @return] @spec]>} ]
${:name} [$sub name]
[$sub pinfo get -default "" bundle parametersyntax]
@@ -49,7 +49,7 @@
[:for param [$sub !get @parameter] {
[$param name]
- [:? {[$param eval {info exists :spec}] && [$param spec] ne ""} {<[$param spec]>}]
+ [:? {[$param eval {info exists :@spec}] && [$param @spec] ne ""} {<[$param @spec]>}]
[$param as_text]
[join [$param pinfo get -default "" validation]
]
@@ -85,7 +85,7 @@
[:for param [:!get @parameter] {
[$param name]
- [:? {[$param eval {info exists :spec}] && [$param spec] ne ""} {<[$param spec]>}]
+ [:? {[$param eval {info exists :@spec}] && [$param @spec] ne ""} {<[$param @spec]>}]
[$param statusmark]
[$param as_text]
Index: library/lib/doc-assets/@method.html.asciidoc
===================================================================
diff -u -rd9b47262886ea198bd62861a30a212ab0e31b3bb -r111bc97fb2853629b153839d2b1f3542f8b50a75
--- library/lib/doc-assets/@method.html.asciidoc (.../@method.html.asciidoc) (revision d9b47262886ea198bd62861a30a212ab0e31b3bb)
+++ library/lib/doc-assets/@method.html.asciidoc (.../@method.html.asciidoc) (revision 111bc97fb2853629b153839d2b1f3542f8b50a75)
@@ -1,10 +1,11 @@
+[:!let prefix [expr {[[:get_owning_partof] pinfo get -default 0 bundle ismetaclass] ? "cls": "obj"}]]
[:name]
- obj [:name] [:pinfo get -default "" bundle parametersyntax]
+
$prefix [:name] [:pinfo get -default "" bundle parametersyntax]
[:?var :@method {
[:for sm [:get_sub_methods] {
Index: library/lib/doc-assets/@method.html.yuidoc
===================================================================
diff -u -rd9b47262886ea198bd62861a30a212ab0e31b3bb -r111bc97fb2853629b153839d2b1f3542f8b50a75
--- library/lib/doc-assets/@method.html.yuidoc (.../@method.html.yuidoc) (revision d9b47262886ea198bd62861a30a212ab0e31b3bb)
+++ library/lib/doc-assets/@method.html.yuidoc (.../@method.html.yuidoc) (revision 111bc97fb2853629b153839d2b1f3542f8b50a75)
@@ -1,11 +1,12 @@
[:!let modifier [expr {[:pinfo get -default 0 bundle call-protected]?"protected":""}]]
[:!let depr [expr {[:!get @deprecated]?"deprecated":""}]]
+[:!let prefix [expr {[[:get_owning_partof] pinfo get -default 0 bundle ismetaclass] ? "cls": "obj"}]]
[:print_name -status]
- [:? {[info exists :@return] && [${:@return} spec] ne ""} {<[${:@return} spec]>} ]
- obj
+
+ $prefix
${:name}
[:pinfo get -default "" bundle parametersyntax]
@@ -26,7 +27,8 @@
[:for param [:!get @parameter] {
[$param print_name]
- [:? {[$param eval {info exists :spec}] && [$param spec] ne ""} {<[$param spec]>}]
+ [:? {[$param eval {info exists :@spec}] && [$param @spec] ne
+ ""} {: [$param @spec]}]
[$param statusmark]
[$param as_text]
@@ -45,7 +47,7 @@
- Returns:
[:!let ret [:!get @return]]
-
[:? {[$ret eval {info exists :spec}] && [$ret spec] ne ""} {[$ret spec]}]
+ [:? {[$ret eval {info exists :@spec}] && [$ret @spec] ne ""} {[$ret @spec]}]
-
[join [$ret pinfo get -default "" validation]]
@@ -63,7 +65,7 @@
[:? {[:!get @syshook] || [:pinfo exists bundle type]} {
- - Type:
+ - Implementation details:
- [:pinfo get bundle type]
[:? {[:!get @syshook]} {
-
internally called, redefinable hook
Index: library/lib/doc-assets/attributemethod.html.asciidoc
===================================================================
diff -u -r7c5b655f1dded2eaf5792f0966de9e5410d26b3f -r111bc97fb2853629b153839d2b1f3542f8b50a75
--- library/lib/doc-assets/attributemethod.html.asciidoc (.../attributemethod.html.asciidoc) (revision 7c5b655f1dded2eaf5792f0966de9e5410d26b3f)
+++ library/lib/doc-assets/attributemethod.html.asciidoc (.../attributemethod.html.asciidoc) (revision 111bc97fb2853629b153839d2b1f3542f8b50a75)
@@ -1,10 +1,11 @@
+[:!let prefix [expr {[[:get_owning_partof] pinfo get -default 0 bundle ismetaclass] ? "cls": "obj"}]]
-
${:name}
-
-
obj ${:name}
+
$prefix ${:name}
?value?
[$owning_attribute as_text]
Parameters
@@ -24,7 +25,7 @@
${:name} add
-
-
obj ${:name} add value
+ $prefix ${:name} add value
Parameters
- value
@@ -38,7 +39,7 @@
${:name} delete
-
-
obj ${:name} delete value
+ $prefix ${:name} delete value
Parameters
- value
Index: library/lib/doc-assets/attributemethod.html.yuidoc
===================================================================
diff -u -r8cfd5973ca93d4c014d0a0500bc4151972e1d80a -r111bc97fb2853629b153839d2b1f3542f8b50a75
--- library/lib/doc-assets/attributemethod.html.yuidoc (.../attributemethod.html.yuidoc) (revision 8cfd5973ca93d4c014d0a0500bc4151972e1d80a)
+++ library/lib/doc-assets/attributemethod.html.yuidoc (.../attributemethod.html.yuidoc) (revision 111bc97fb2853629b153839d2b1f3542f8b50a75)
@@ -1,11 +1,13 @@
[:!let modifier [expr {[:pinfo get -default 0 bundle call-protected]?"protected":""}]]
+[:!let prefix [expr {[[:get_owning_partof] pinfo get -default 0 bundle ismetaclass] ? "cls": "obj"}]]
[:!let depr [expr {[:!get @deprecated]?"deprecated":""}]]
+
[$owning_attribute print_name -status]
- [:? {[info exists :@return] && [${:@return} spec] ne ""} {<[${:@return} spec]>} ]
- obj ${:name} ?value?
+
+ $prefix ${:name} ?value?
@@ -26,59 +28,66 @@
- Parameters:
-
-
value <optional>
+ [:!let spec "optional"]
+ [:?objvar $owning_attribute @spec {
+ [:!let spec [join [list $spec {*}[$owning_attribute @spec]] ,]]
+ }]
+ value : $spec
- If provided, list of values to
- be set for the attribute ${:name}
+ If provided, the
+ attribute ${:name} is set to value. If omitted, the current attribute
+ value is returned.
-
- [:?objvar $owning_attribute @return {
+ [:?objvar $owning_attribute @spec {
- Returns:
-
[:? {[${:@return} eval {info exists :spec}] && [${:@return} spec] ne ""} {[${:@return} spec]}]
+ [:? {[$owning_attribute @spec] ne ""} {[$owning_attribute @spec]}]
- - [${:@return} as_text]
}]
- - Type:
- - [:pinfo get bundle type]
- attribute accessor/mutator
+ - Implementation details:
+ - [:pinfo get bundle type]
- attribute getter/setter
- - Protection:
[:? {[:pinfo get -default 0 bundle redefine-protected]} {
+ - Protection:
- redefine-protected
- }]
+ }]
[:? {[$owning_attribute pinfo get -default 0 bundle incremental]} {
${:name} add
- [:? {[info exists :@return] && [${:@return} spec] ne ""} {<[${:@return} spec]>} ]
- obj
+
+ $prefix
${:name} add
value
- Parameters:
-
-
value <required>
+ value
+ [:?objvar $owning_attribute @spec {
+ [:? {[$owning_attribute @spec] ne ""} { : [$owning_attribute @spec]}]
+ }]
+
- ...
+
-
+
@@ -88,7 +97,7 @@
${:name} delete
- [:? {[info exists :@return] && [${:@return} spec] ne ""} {<[${:@return} spec]>} ]
+
obj
${:name} delete
value
@@ -97,16 +106,19 @@
- Parameters:
-
-
value <required>
+ value
+ [:?objvar $owning_attribute @spec {
+ [:? {[$owning_attribute @spec] ne ""} { : [$owning_attribute @spec]}]
+ }]
- ...
+
-
+
Index: library/lib/doc-assets/hookmethod.html.yuidoc
===================================================================
diff -u -rbbf48b80f31cfe50ba2114cf0ec6f1465b60c2e1 -r111bc97fb2853629b153839d2b1f3542f8b50a75
--- library/lib/doc-assets/hookmethod.html.yuidoc (.../hookmethod.html.yuidoc) (revision bbf48b80f31cfe50ba2114cf0ec6f1465b60c2e1)
+++ library/lib/doc-assets/hookmethod.html.yuidoc (.../hookmethod.html.yuidoc) (revision 111bc97fb2853629b153839d2b1f3542f8b50a75)
@@ -10,7 +10,7 @@
[:print_name]$status
- [:? {[info exists :@return] && [${:@return} spec] ne ""} {<[${:@return} spec]>} ]
+ [:? {[info exists :@return] && [${:@return} @spec] ne ""} {<[${:@return} @spec]>} ]
obj
${:name}
$paramspec
@@ -26,7 +26,7 @@
[:for param [:!get @parameter] {
-
[$param print_name]
- [:? {[$param eval {info exists :spec}] && [$param spec] ne ""} {<[$param spec]>}]
+ [:? {[$param eval {info exists :@spec}] && [$param @spec] ne ""} {<[$param @spec]>}]
[:? {[:statustoken] ne "extra"} {
[$param statusmark]
@@ -47,7 +47,7 @@
- Returns:
[:!let ret [:!get @return]]
-
[:? {[$ret eval {info exists :spec}] && [$ret spec] ne ""} {[$ret spec]}]
+ [:? {[$ret eval {info exists :@spec}] && [$ret @spec] ne ""} {[$ret @spec]}]
-
[join [$ret pinfo get -default "" validation]]
Index: library/lib/doc-assets/submethod.html.asciidoc
===================================================================
diff -u -r7c5b655f1dded2eaf5792f0966de9e5410d26b3f -r111bc97fb2853629b153839d2b1f3542f8b50a75
--- library/lib/doc-assets/submethod.html.asciidoc (.../submethod.html.asciidoc) (revision 7c5b655f1dded2eaf5792f0966de9e5410d26b3f)
+++ library/lib/doc-assets/submethod.html.asciidoc (.../submethod.html.asciidoc) (revision 111bc97fb2853629b153839d2b1f3542f8b50a75)
@@ -1,11 +1,12 @@
+[:!let prefix [expr {[[:get_owning_partof] pinfo get -default 0 bundle ismetaclass] ? "cls": "obj"}]]
[:!let name [:get_combined name]]
-
$name
-
-
obj $name [:pinfo get -default "" bundle parametersyntax]
+
$prefix $name [:pinfo get -default "" bundle parametersyntax]
[:?var :@parameter {
Parameters
Index: library/lib/doc-assets/submethod.html.yuidoc
===================================================================
diff -u -r77c371a2e4a1bd85367d11869de6e2dc9fac4771 -r111bc97fb2853629b153839d2b1f3542f8b50a75
--- library/lib/doc-assets/submethod.html.yuidoc (.../submethod.html.yuidoc) (revision 77c371a2e4a1bd85367d11869de6e2dc9fac4771)
+++ library/lib/doc-assets/submethod.html.yuidoc (.../submethod.html.yuidoc) (revision 111bc97fb2853629b153839d2b1f3542f8b50a75)
@@ -1,10 +1,11 @@
[:!let name [:get_combined name]]
+[:!let prefix [expr {[[:get_owning_partof] pinfo get -default 0 bundle ismetaclass] ? "cls": "obj"}]]
$name[:statusmark]
- [:? {[info exists :@return] && [${:@return} spec] ne ""} {<[${:@return} spec]>} ]
- obj
+ [:? {[info exists :@return] && [${:@return} @spec] ne ""} { : [${:@return} @spec]} ]
+ $prefix
$name
[:pinfo get -default "" bundle parametersyntax]
@@ -16,7 +17,7 @@
[:for param ${:@parameter} {
-
[$param name]
- [:? {[$param eval {info exists :spec}] && [$param spec] ne ""} {<[$param spec]>}]
+ [:? {[$param eval {info exists :@spec}] && [$param @spec] ne ""} { : [$param @spec]}]
[$param statusmark]
[$param as_text]
Index: library/lib/doc-tools.tcl
===================================================================
diff -u -r340c1572913656239bb09237b9b1d1b83f6442cb -r111bc97fb2853629b153839d2b1f3542f8b50a75
--- library/lib/doc-tools.tcl (.../doc-tools.tcl) (revision 340c1572913656239bb09237b9b1d1b83f6442cb)
+++ library/lib/doc-tools.tcl (.../doc-tools.tcl) (revision 111bc97fb2853629b153839d2b1f3542f8b50a75)
@@ -1130,6 +1130,27 @@
next
}
}
+ :public method validate {} {
+ next
+ #
+ # TODO: Certain metadata could also be valid in "missing"
+ # state, e.g., paramtersyntax? Re-arrange later ...
+ #
+ if {[info exists :pdata] &&
+ [:pinfo get -default complete status] ne "missing"} {
+ #
+ # Note: Some metadata on classes cannot be retrieved from
+ # within the tracers, as they might not be set local to the
+ # class definition. Hence, we gather them at this point.
+ #
+ set prj [:current_project]
+ set box [$prj sandbox]
+ set statement [list ::nsf::dispatch ${:name} \
+ ::nsf::methods::class::info::objectparameter \
+ parametersyntax]
+ :pinfo set bundle parametersyntax [$box eval $statement]
+ }
+ }
}
Class create PartEntity -superclass Entity {
@@ -1313,7 +1334,8 @@
#
PartTag create @param \
-superclass PartEntity {
- :attribute spec
+ #:attribute spec
+ :attribute @spec -class ::nx::doc::PartAttribute
:attribute default
:public class method id {partof_name scope name} {
@@ -1350,7 +1372,7 @@
set spec ""
regexp {^(.*):(.*)$} $name _ name spec
:createOrConfigure [:id $partof [$part_attribute scope] $name] \
- -spec $spec \
+ -@spec $spec \
-name $name \
-partof $partof \
{*}[expr {$def ne "" ? "-default $def" : ""}] \
@@ -2274,7 +2296,8 @@
# An xowiki backend
#
- namespace eval ::xowiki {
+ namespace eval ::xowiki {
+ namespace import -force ::nx::*
Class create Page -attributes {
{lang en} {description ""} {text ""} {nls_language en_US}
{mime_type text/html} {title ""} name text
@@ -2542,8 +2565,6 @@
return [list $name [list $spec $default]]
}
-
-
proc __trace_pkg {} {
# ::interp hide "" source
@@ -2640,14 +2661,36 @@
foreach {cmd isexported} $delta_commands {
set bundle [dict create]
- if {![catch {set syntax [::nsf::dispatch $rootclass ::nsf::methods::object::info::method parametersyntax $cmd]} _]} {
- dict set bundle parametersyntax $syntax
- }
+ set infoMethod ::nsf::methods::object::info::method
+ if {[::nsf::object::exists $cmd]} {
+ #
+ # TODO: Only classes are provided with parametersyntax
+ # info. Is this sufficient?!
+ #
+ if {[::nsf::is class $cmd]} {
- if {![catch {set pa [::nsf::dispatch $rootclass ::nsf::methods::object::info::method parameter $cmd]} _]} {
- foreach pspec $pa {
- dict set bundle parameter {*}[::nx::doc::paraminfo {*}$pspec]
+ dict set bundle parametersyntax [::nsf::dispatch $cmd \
+ ::nsf::methods::class::info::objectparameter \
+ parametersyntax]
+ #
+ # TODO: Are the parameters needed for objects???
+ #
+ # dict set bundle parameter [::nsf::dispatch $cmd \
+ # ::nsf::methods::class::info::objectparameter \
+ # parameter]
}
+ } else {
+ if {![catch {set syntax [::nsf::dispatch $rootclass $infoMethod \
+ parametersyntax $cmd]} _]} {
+ dict set bundle parametersyntax $syntax
+ }
+
+ if {![catch {set pa [::nsf::dispatch $rootclass $infoMethod \
+ parameter $cmd]} _]} {
+ foreach pspec $pa {
+ dict set bundle parameter {*}[::nx::doc::paraminfo {*}$pspec]
+ }
+ }
}
::nx::doc::__at_register_command $cmd \
@@ -2724,6 +2767,7 @@
if {[::nsf::dispatch $obj ::nsf::methods::object::info::hastype ::nx::EnsembleObject]} {
dict set bundle objtype ensemble
}
+ dict set bundle ismetaclass [::nsf::is metaclass $obj]
}
set cmdtype [expr {[::nsf::is class $obj]?"@class":"@object"}]
::nx::doc::__at_register_command $obj \
@@ -2953,12 +2997,15 @@
args
} {
uplevel [list ::nsf::_%&createobjectsystem $rootclass $rootmclass {*}$args]
+
foreach r [list $rootclass $rootmclass] {
+ dict set bundle ismetaclass [::nsf::is metaclass $r]
::nx::doc::__at_register_command $r \
->cmdtype @class \
->source [file normalize [info script]] \
->nsexported [::nx::doc::is_exported $r] \
- {*}[expr {[::nsf::var::exists $r __initcmd] && [::nsf::var::set $obj __initcmd] ne ""?[list ->docstring [::nsf::var::set $r __initcmd]]:[list]}]
+ {*}[expr {[::nsf::var::exists $r __initcmd] && [::nsf::var::set $obj __initcmd] ne ""?[list ->docstring [::nsf::var::set $r __initcmd]]:[list]}] \
+ ->bundle $bundle
}
}
Index: library/nx/nx.nxd
===================================================================
diff -u -r1c53605d5ae1904a7b3bbde73aec12375f6dfea4 -r111bc97fb2853629b153839d2b1f3542f8b50a75
--- library/nx/nx.nxd (.../nx.nxd) (revision 1c53605d5ae1904a7b3bbde73aec12375f6dfea4)
+++ library/nx/nx.nxd (.../nx.nxd) (revision 111bc97fb2853629b153839d2b1f3542f8b50a75)
@@ -65,6 +65,7 @@
# Register the specified class(es) as per-object <<@glspl
# mixin_class>>. Every mixin must be an existing class.
#
+# @spec object,type=::nx::Class
# @class.attribute {Object noinit}
#