Index: apps/utils/nxdoc =================================================================== diff -u -N -r02348ab7dbfe333906bfb0bd63a5d431692dc602 -r263cd750f41d98badaae2b2d06bb2ea58feb99e4 --- apps/utils/nxdoc (.../nxdoc) (revision 02348ab7dbfe333906bfb0bd63a5d431692dc602) +++ apps/utils/nxdoc (.../nxdoc) (revision 263cd750f41d98badaae2b2d06bb2ea58feb99e4) @@ -96,8 +96,8 @@ interp delete $i } - :protected class method objectparameter {} { - set slots [:info slot objects] + :protected method __objectparameter {} { + set slots [[current class] info slots] foreach slot $slots { lappend defs([$slot position]) [$slot getParameterSpec] } Index: library/lib/nxdoc-core.tcl =================================================================== diff -u -N -r2f6bcca3537584c8ef1f9fc71b230e79d1560504 -r263cd750f41d98badaae2b2d06bb2ea58feb99e4 --- library/lib/nxdoc-core.tcl (.../nxdoc-core.tcl) (revision 2f6bcca3537584c8ef1f9fc71b230e79d1560504) +++ library/lib/nxdoc-core.tcl (.../nxdoc-core.tcl) (revision 263cd750f41d98badaae2b2d06bb2ea58feb99e4) @@ -100,8 +100,8 @@ foreach mixin [:info children -type [current class]::Mixin] { set base "${:prefix}::[namespace tail $mixin]" if {[::nsf::object::exists $base]} { - set scope [expr {[$mixin scope] eq "object" && \ - [$base info has type ::nx::Class]?"class":""}] + set scope [expr {[$mixin scope] eq "object"?"object":""}] + #set scope "object" dict lappend :active_mixins $base $mixin $base eval [list : -system {*}$scope mixin add $mixin] } @@ -120,7 +120,7 @@ } Class create [current]::Mixin -superclass Class { - :property {scope class} + :property -accessor public {scope class} } } @@ -136,12 +136,12 @@ # @param root_namespace You may choose your own root-level # namespace hosting the namespace hierarchy of entity objects - :property {tag {[string trimleft [string tolower [namespace tail [current]]] @]}} - :property {root_namespace "::nx::doc::entities"} + :property -accessor public {tag {[string trimleft [string tolower [namespace tail [current]]] @]}} + :property -accessor protected {root_namespace "::nx::doc::entities"} namespace eval ::nx::doc::entities {} - :public class method normalise {tagpath names} { + :public object method normalise {tagpath names} { # 1) verify balancedness of path spec elements if {[llength $tagpath] != [llength $names]} { return [list 1 "Imbalanced tag line spec: '$tagpath' vs. '$names'"] @@ -159,7 +159,7 @@ } - :public class method find { + :public object method find { -strict:switch -all:switch tagpath @@ -299,7 +299,7 @@ # TODO: We don't need the stack-like dispensing of containers, # make it a simple one-element store - :public class property containers:0..*,object,type=::nx::doc::ContainerEntity { + :object property containers:0..*,object,type=::nx::doc::ContainerEntity { set :incremental 1 } @@ -404,19 +404,19 @@ # # The property refers to a concrete subclass of Part which # describes the parts being managed by the property. - :property part_class:optional,class { - :public method assign {domain prop value} { + :property -accessor public part_class:optional,class { + :public object method assign {domain prop value} { set owningClass [[$domain info parent] info parent] if {"::nx::doc::ContainerEntity" in [concat $owningClass [$owningClass info heritage]]} { - $value class mixin add ::nx::doc::ContainerEntity::Containable + $value object mixin add ::nx::doc::ContainerEntity::Containable } next } } - :property scope + :property -accessor public scope - :property {pretty_name {[string totitle [string trimleft [namespace tail [current]] @]]}} - :property {pretty_plural {[string totitle [string trimleft [namespace tail [current]] @]]}} + :property -accessor public {pretty_name {[string totitle [string trimleft [namespace tail [current]] @]]}} + :property -accessor public {pretty_plural {[string totitle [string trimleft [namespace tail [current]] @]]}} # :forward owning_entity_class {% [[:info parent] info parent] } :method init args { @@ -533,13 +533,13 @@ # @.parameter name # # gives you the name (i.e., the Nx object identifier) of the documented entity - :property name:any,required + :property -accessor public name:any,required - :class property current_project:object,type=::nx::doc::@project,0..1 + :object property -accessor public current_project:object,type=::nx::doc::@project,0..1 :public forward current_project [current] %method - :property partof:object,type=::nx::doc::StructuredEntity - :property part_attribute:object,type=::nx::doc::PartAttribute + :property -accessor public partof:object,type=::nx::doc::StructuredEntity + :property -accessor public part_attribute:object,type=::nx::doc::PartAttribute :public method get_fqn_command_name {} { @@ -634,7 +634,7 @@ } :property @use { - :public method assign {domain prop value} { + :public object method assign {domain prop value} { lassign $value pathspec pathnames if {$pathnames eq ""} { set pathnames $pathspec @@ -700,9 +700,9 @@ # @class @glossary @glossary eval { - :property @pretty_name - :property @pretty_plural - :property @acronym + :property -accessor public @pretty_name + :property -accessor public @pretty_plural + :property -accessor public @acronym } @@ -803,7 +803,7 @@ } } - :property previous:object,type=[current] + :property -accessor public previous:object,type=[current] :public method announceAsContainer {tag:object,type=::nx::doc::Tag} { $tag containers push [current] @@ -830,9 +830,9 @@ # Doc entity interface # / / / / / / / / / / / / / / / / / / - :public property sandbox:object,type=::nx::doc::Sandbox + :property -accessor public sandbox:object,type=::nx::doc::Sandbox - :property url + :property -accessor public url :property license :property creationdate :property {version ""} @@ -842,7 +842,7 @@ :property -class ::nx::doc::PartAttribute @glossary { :part_class ::nx::doc::@glossary - :public method get {domain prop} { + :public object method get {domain prop} { set l [next] if {[$domain eval {info exists :depends}]} { foreach d [$domain depends] { @@ -853,7 +853,7 @@ } } - :property -class ::nx::doc::PartAttribute @package { + :property -accessor protected -class ::nx::doc::PartAttribute @package { :pretty_name "Package" :pretty_plural "Packages" :part_class ::nx::doc::@package @@ -871,7 +871,7 @@ :frontend $frontend $srcs $cmds } - :public class method newFromSources { + :public object method newFromSources { {-frontend dc} {-sandboxed:boolean 1} -include @@ -1060,7 +1060,7 @@ :part_class ::nx::doc::@param } :property -class ::nx::doc::PartAttribute @return { - :method require_part {domain prop value} { + :object method require_part {domain prop value} { set value [expr {![string match ":*" $value] ? "__out__: $value": "__out__$value"}] next [list $domain $prop $value] } @@ -1072,7 +1072,7 @@ :property -class ::nx::doc::PartAttribute @command { :pretty_name "Subcommand" :pretty_plural "Subcommands" - :public method id {domain prop value} { + :public object method id {domain prop value} { return [${:part_class} [current method] \ -partof_name [$domain name] \ -scope ${:scope} -- $value] @@ -1087,7 +1087,7 @@ :property -class ::nx::doc::PartAttribute @child-object { :part_class ::nx::doc::@object - :public method id {domain prop value} { + :public object method id {domain prop value} { return [${:part_class} id [join [list [$domain name] $value] ::]] } @@ -1097,7 +1097,7 @@ :property -class ::nx::doc::PartAttribute @child-class { :part_class ::nx::doc::@class - :public method id {domain prop value} { + :public object method id {domain prop value} { return [${:part_class} id [join [list [$domain name] $value] ::]] } } @@ -1160,7 +1160,7 @@ :pretty_name "Provided method" :pretty_plural "Provided methods" :part_class ::nx::doc::@method - :method require_part {domain prop value} { + :object method require_part {domain prop value} { # TODO: verify whether these scoping checks are sufficient # and/or generalisable: For instance, is the scope # requested (from the part_attribute) applicable to the @@ -1208,14 +1208,14 @@ # be displayed. I shall fix this later and refactor it to a # shared place between @method and @command. # - :method require_part {domain prop value} { + :object method require_part {domain prop value} { set value [expr {![string match ":*" $value] ? "__out__: $value": "__out__$value"}] next [list $domain $prop $value] } :part_class ::nx::doc::@param } - :public class method new { + :public object method new { -part_attribute:required -partof:object,type=::nx::doc::Entity -name:any,required @@ -1237,7 +1237,7 @@ :property -class ::nx::doc::PartAttribute @method { :part_class ::nx::doc::@method - :public method id {domain prop name} { + :public object method id {domain prop name} { # TODO: ${:part_class} resolves to the local slot # [current], rather than ::nx::doc::@method. Why? if {[$domain eval {: -system info has type ::nx::doc::@method}]} { @@ -1304,7 +1304,7 @@ :property -class ::nx::doc::PartAttribute @spec :property default - :public class method id {partof_name scope name} { + :public object method id {partof_name scope name} { next [list [:get_unqualified_name ${partof_name}] $scope $name] } @@ -1318,7 +1318,7 @@ # @param -name # @param args - :public class method new { + :public object method new { -part_attribute -partof:required -name:any,required @@ -1382,23 +1382,23 @@ Class create TemplateData { - :class property renderer + :object property -accessor public renderer :public forward renderer [current] %method :public forward rendered [current] %method - :class method "rendered push" {e:object,type=::nx::doc::Entity} { + :object method "rendered push" {e:object,type=::nx::doc::Entity} { if {![info exists :__rendered_entity]} { set :__rendered_entity [list] } set :__rendered_entity [concat $e {*}${:__rendered_entity}] } - :class method "rendered pop" {} { + :object method "rendered pop" {} { set :__rendered_entity [lassign ${:__rendered_entity} e] return $e } - :class method "rendered top" {} { + :object method "rendered top" {} { return [lindex ${:__rendered_entity} 0] } @@ -1663,8 +1663,8 @@ # template management # - :property current_theme - :protected property {templates {[dict create]}} + :property -accessor public current_theme + :property {templates {[dict create]}} :public method addTemplate {name theme body} { dict set :templates $theme $name $body @@ -1842,21 +1842,21 @@ namespace import -force ::nx::* Class create Sandbox { - :public class method type=in {name value arg} { + :public object method type=in {name value arg} { if {$value ni [split $arg |]} { error "The value '$value' provided for parameter $name not permissible." } return $value } - :public class method type=fqn {name value} { + :public object method type=fqn {name value} { if {[string first "::" $value] != 0} { error "The value '$value' must be a fully-qualified Tcl name." } return $value } - :public class method type=fpathtype {name value arg} { + :public object method type=fpathtype {name value arg} { # # Note: We might receive empty strings in case of [eval]s! # @@ -1867,7 +1867,7 @@ return $value } - :public class method type=nonempty {name value} { + :public object method type=nonempty {name value} { if {$value eq ""} { return \ -code error \ @@ -1876,7 +1876,7 @@ return $value } - :protected property {current_packages ""} + :property -accessor protected {current_packages ""} :public method "permissive lappend" {type value} { set d [lindex [current methodpath] 0] @@ -2334,7 +2334,7 @@ set obj $modifier set scope "" set name "" - } elseif {$modifier eq "class"} { + } elseif {$modifier eq "object"} { set scope $modifier set name [lindex $definition 4] } else { @@ -2566,9 +2566,9 @@ next } - :protected property {interp ""}; # the default empty string points to the current interp + :property -accessor public {interp ""}; # the default empty string points to the current interp - :public property registered_commands + :property -accessor public registered_commands :public method get_companions {} { set companions [dict create] Index: library/lib/nxdoc-dc.tcl =================================================================== diff -u -N -rea3bbe8b1039c45baa2c027c005151e04e57d4b1 -r263cd750f41d98badaae2b2d06bb2ea58feb99e4 --- library/lib/nxdoc-dc.tcl (.../nxdoc-dc.tcl) (revision ea3bbe8b1039c45baa2c027c005151e04e57d4b1) +++ library/lib/nxdoc-dc.tcl (.../nxdoc-dc.tcl) (revision 263cd750f41d98badaae2b2d06bb2ea58feb99e4) @@ -21,7 +21,7 @@ nx::Class create [current]::DependencyEntity { - :class property {instances:0..*,object,type=::nx::doc::Entity ""} { + :object property {instances:0..*,object,type=::nx::doc::Entity ""} { set :incremental 1 } :public method init args { @@ -62,8 +62,8 @@ return $inst } - nx::Class create [current]::ProvidedEntity { - :class property {instances:0..*,object,type=::nx::doc::Entity ""} { + nx::Class create [current]::ProvidedEntity { + :object property {instances:0..*,object,type=::nx::doc::Entity ""} { set :incremental 1 } :public method init args { @@ -216,7 +216,7 @@ # / / / / / / / / / / / / / / / / / / / / / / / / / / / / / # PROCESSOR foreach {attr part_class} [$project part_attributes] { - $part_class class mixin add ::nx::doc::ContainerEntity::Containable + $part_class object mixin add ::nx::doc::ContainerEntity::Containable $part_class container $project } @@ -471,7 +471,7 @@ set box [$project sandbox] # methods - foreach methodName [$box do [list ${name} {*}$scope info methods\ + foreach methodName [$box do [list ${name} info {*}$scope methods\ -type scripted \ -callprotection public]] { @@ -483,7 +483,7 @@ -tag @$tag \ -name $methodName \ -parsing_level 2 \ - [$box do [list ${name} {*}$scope info method body $methodName]] + [$box do [list ${name} info {*}$scope method body $methodName]] } } } @@ -500,9 +500,9 @@ # Class create CommentBlockParser { - :property {parsing_level:integer 0} + :property -accessor public {parsing_level:integer 0} - :property {message ""} + :property -accessor protected {message ""} :property {status:in "COMPLETED"} { set :incremental 1 @@ -515,35 +515,36 @@ LEVELMISMATCH } - :public method type=in {name value} { + :public object method type=in {name value} { if {$value ni ${:statuscodes}} { error "Invalid statuscode '$code'." } return $value } - :public method ? [list obj var value:in,slot=[current object]] { + :public object method ? [list obj var value:in,slot=[current object]] { return [expr {[:get $obj $var] eq $value}] } - :public method is {obj var value} { + :public object method is {obj var value} { return [expr {$value in ${:statuscodes}}] } } - :property processed_section { - :public method assign {domain prop value} { + :property -accessor public processed_section { + :public object method assign {domain prop value} { set current_entity [$domain current_entity] - set scope [expr {[$current_entity info has type ::nx::Class]?"class":""}] - if {[$domain eval [list info exists :$prop]] && [:get $domain $prop] in [$current_entity eval [list : -system {*}$scope info mixin classes]]} { + set scope "object" + #set scope [expr {[$current_entity info has type ::nx::Class]?"object":""}] + if {[$domain eval [list info exists :$prop]] && [:get $domain $prop] in [$current_entity eval [list : -system info {*}$scope mixin classes]]} { $current_entity eval [list : -system {*}$scope mixin delete [:get $domain $prop]] } $current_entity eval [list : -system {*}$scope mixin add [next [list $domain $prop $value]]] } } - :property current_entity:object + :property -accessor public current_entity:object - :public class method process { + :public object method process { {-partof_entity ""} {-initial_section context} {-parsing_level 0} @@ -643,8 +644,10 @@ # ${:current_entity} {*}$scope mixin delete ${:processed_section} # } - set scope [expr {[${:current_entity} info has type ::nx::Class]?"class":""}] - set mixins [${:current_entity} {*}$scope info mixin classes] + #set scope [expr {[${:current_entity} info has type ::nx::Class]?"object":""}] + set scope "object" + + set mixins [${:current_entity} info {*}$scope mixin classes] if {${:processed_section} in $mixins} { set idx [lsearch -exact $mixins ${:processed_section}] set mixins [lreplace $mixins $idx $idx] @@ -657,15 +660,15 @@ Class create CommentBlockParsingState -superclass Class { - :property next_comment_section - :property comment_line_transitions:required + :property -accessor public next_comment_section + :property -accessor public comment_line_transitions:required } Class create CommentSection { - :property block_parser:object,type=::nx::doc::CommentBlockParser - :property {current_comment_line_type ""} + :property -accessor public block_parser:object,type=::nx::doc::CommentBlockParser + :property -accessor public {current_comment_line_type ""} set :line_types { tag {regexp -- {^\s*@[^[:space:]@]+} $line} Index: library/lib/nxdoc-html.tcl =================================================================== diff -u -N -re0f9892926cd7c2c3bf54a1e7d1d945a5c77e7ca -r263cd750f41d98badaae2b2d06bb2ea58feb99e4 --- library/lib/nxdoc-html.tcl (.../nxdoc-html.tcl) (revision e0f9892926cd7c2c3bf54a1e7d1d945a5c77e7ca) +++ library/lib/nxdoc-html.tcl (.../nxdoc-html.tcl) (revision 263cd750f41d98badaae2b2d06bb2ea58feb99e4) @@ -8,7 +8,7 @@ Renderer create html { - :class method render {project entity theme {tmplName ""}} { + :object method render {project entity theme {tmplName ""}} { set top_level_entities [$project navigatable_parts] set init [subst { set project $project @@ -19,7 +19,7 @@ $entity render -initscript $init -theme $theme {*}$tmplName } - :class method installAssets {project theme targetDir} { + :object method installAssets {project theme targetDir} { set assets [glob -directory [file join [findAssetPath] $theme] *] file mkdir $targetDir if {$assets eq ""} return; Index: library/lib/nxdoc-xowiki.tcl =================================================================== diff -u -N -re0f9892926cd7c2c3bf54a1e7d1d945a5c77e7ca -r263cd750f41d98badaae2b2d06bb2ea58feb99e4 --- library/lib/nxdoc-xowiki.tcl (.../nxdoc-xowiki.tcl) (revision e0f9892926cd7c2c3bf54a1e7d1d945a5c77e7ca) +++ library/lib/nxdoc-xowiki.tcl (.../nxdoc-xowiki.tcl) (revision 263cd750f41d98badaae2b2d06bb2ea58feb99e4) @@ -14,18 +14,18 @@ nx::Class create Page { :property {lang en} :property {description ""} - :property {text ""} + :property -accessor public {text ""} :property {nls_language en_US} :property {mime_type text/html} - :property {title ""} + :property -accessor public {title ""} :property name :property text :property page_order # # For representing a folder structure # :property parent_id - :property item_id + :property -accessor public item_id } nx::Class create File -superclass Page @@ -173,7 +173,7 @@ next } - :public class method mkFolder {entity} -returns object,type=[current] { + :public object method mkFolder {entity} -returns object,type=[current] { return [:new -name en:[$entity filename] -title [$entity print_name]] } @@ -196,7 +196,12 @@ :public method serialize {} { set map [list [current class] [[: -system info class] info superclass]] - set ignore [join [[current class] info slot names] |] + set slots [[current class] info slots] + set names [list] + foreach s $slots { + lappend names [$s name] + } + set ignore [join $names |] append script [::Serializer deepSerialize -map $map -ignoreVarsRE $ignore [current]] if {[info exists :indexPage]} { append script \n [${:indexPage} serialize] @@ -336,7 +341,7 @@ } - :class method render { + :object method render { project entity:object,type=::nx::doc::StructuredEntity theme @@ -362,9 +367,9 @@ set fwdTarget [list ::base64::encode] } - :class forward asBase64 {*}$fwdTarget + :object forward asBase64 {*}$fwdTarget - :class method installAssets {project theme targetDir} { + :object method installAssets {project theme targetDir} { # # render and append single glossary page to the output #