diff --git a/src/kernel/class.jam b/src/kernel/class.jam index 3dd55b098..046ff0a9e 100644 --- a/src/kernel/class.jam +++ b/src/kernel/class.jam @@ -9,26 +9,26 @@ # the "constructor", which in turn sets instance attributes and # defines rules: # -# rule myclass ( arg1 ) # constructor -# { -# self.attribute = $(arg1) ; -# -# rule method1 ( ) # method -# { -# return [ method2 ] ; -# } -# -# rule method2 ( ) # method -# { -# return $(self.attribute) ; -# } -# } -# class myclass ; # establish myclass as a class +#:: rule myclass ( arg1 ) # constructor +#:: { +#:: self.attribute = $(arg1) ; +#:: +#:: rule method1 ( ) # method +#:: { +#:: return [ method2 ] ; +#:: } +#:: +#:: rule method2 ( ) # method +#:: { +#:: return $(self.attribute) ; +#:: } +#:: } +#:: class myclass ; # establish myclass as a class # # New instance modules are created by invoking [ new ]: # -# local x = [ new myclass foo ] ; # x is a new myclass object -# assert.result foo : [ $(x).method1 ] ; # $(x).method1 returns "foo" +#:: local x = [ new myclass foo ] ; # x is a new myclass object +#:: assert.result foo : [ $(x).method1 ] ; # $(x).method1 returns "foo" # # To write a derived class, you must: # @@ -37,21 +37,21 @@ # # 2. add the base classes to the derived class declaration. # -# rule derived ( arg ) -# { -# myclass.__init__ $(arg) ; # call base __init__ -# rule method2 ( ) # method override -# { -# return $(self.attribute)XXX ; -# } -# } -# class derived : myclass ; +#:: rule derived ( arg ) +#:: { +#:: myclass.__init__ $(arg) ; # call base __init__ +#:: rule method2 ( ) # method override +#:: { +#:: return $(self.attribute)XXX ; +#:: } +#:: } +#:: class derived : myclass ; # # All methods operate virtually, replacing behavior in the base # classes. For example: # -# local y = [ new derived foo ] ; # y is a new derived object -# assert.result fooXXX : [ $(y).method1 ] ; # $(y).method1 returns "foo" +#:: local y = [ new derived foo ] ; # y is a new derived object +#:: assert.result fooXXX : [ $(y).method1 ] ; # $(y).method1 returns "foo" # # Each class instance is its own core Jam module. All instance # attributes and methods are accessible without additional diff --git a/src/util/print.jam b/src/util/print.jam index b1cbc776a..ec4dc9179 100644 --- a/src/util/print.jam +++ b/src/util/print.jam @@ -52,7 +52,14 @@ rule section ( local paragraph = ; while $(description) && $(description[1]) = "" { description = $(description[2-]) ; } while $(description) && $(description[1]) != "" { paragraph += $(description[1]) ; description = $(description[2-]) ; } - lines [ split-at-words " " $(paragraph) ] : " " ; + if [ MATCH "^(::).*" : $(paragraph) ] + { + lines [ MATCH "^::(.*)" : $(paragraph) ] : " " " " ; + } + else + { + lines [ split-at-words " " $(paragraph) ] : " " ; + } lines ; } } @@ -151,13 +158,15 @@ rule split-at-words ( rule lines ( text * # The lines of text. : indent ? # Optional indentation prepended to each line after the first one. + outdent ? # Optional indentation to prepend to the first line. ) { text ?= "" ; indent ?= "" ; + outdent ?= "" ; if $(output-type) = plain { - text $(text[1]) $(indent)$(text[2-]) ; + text $(outdent)$(text[1]) $(indent)$(text[2-]) ; } else if $(output-type) = html {