From 97e9af5e747fca5840b2ec96dca617247d5fbec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Sat, 23 Aug 2008 11:51:45 +0000 Subject: [PATCH] Updated the comment parsing logic in Boost Build's util/doc.jam module. Now correctly recognizes comment blocks starting with an empty line and correctly parses comment lines where the initial # character is followed by a non-whitespace characters. This for example allows it to correctly process comments written like this: ###################################### # # And example comment. # ###################################### Which would previously not get interpreted as valid module description comment blocks. [SVN r48313] --- v2/util/doc.jam | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/v2/util/doc.jam b/v2/util/doc.jam index 5ebf6e2bc..a75155882 100644 --- a/v2/util/doc.jam +++ b/v2/util/doc.jam @@ -606,7 +606,7 @@ local rule print-help-project ( : jamfile * # The project Jamfile. ) { - if $(jamfile<$(jamfile)>.docs[1]) + if $(jamfile<$(jamfile)>.docs) { # Print the docs. print.section "Project-specific help" @@ -625,7 +625,7 @@ local rule print-help-config ( config-file # The configuration Jamfile. ) { - if $(jamfile<$(config-file)>.docs[1]) + if $(jamfile<$(config-file)>.docs) { # Print the docs. print.section "Configuration help" @@ -649,7 +649,7 @@ local rule extract-comment ( local l = [ MATCH "^[$(ws)]*(#)(.*)$" : $(line) ] ; while $(l[1]) && $($(var)) { - if $(l[2]) { comment += [ MATCH "^[$(ws)](.*)$" : $(l[2]) ] ; } + if $(l[2]) { comment += [ MATCH "^[$(ws)]?(.*)$" : $(l[2]) ] ; } else { comment += "" ; } $(var) = $($(var)[2-]) ; line = $($(var)[1]) ; @@ -908,7 +908,7 @@ rule scan-module ( set-module-copyright $(module-name) : $(comment-block) ; } else if $(action[1]) in "print-help-project" "print-help-config" - && ! $(jamfile<$(target)>.docs[1]) + && ! $(jamfile<$(target)>.docs) { # special module docs for the project jamfile. jamfile<$(target)>.docs = $(comment-block) ;