From 9cb8ee086f40b1a85d454b068d98cef1ee10d04f Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Wed, 18 Oct 2017 18:43:56 -0500 Subject: [PATCH] Guard against redef of asciidoctor in common b2. --- doc/asciidoctor.jam | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/doc/asciidoctor.jam b/doc/asciidoctor.jam index 488670d..56362be 100644 --- a/doc/asciidoctor.jam +++ b/doc/asciidoctor.jam @@ -9,23 +9,26 @@ import scanner ; import generators ; import boostbook ; -# File type - -type.register ASCIIDOC : asciidoc adoc ; - -# Define dependency scanner - -class asciidoc-scanner : common-scanner +if ! [ type.registered ASCIIDOC ] { - rule pattern ( ) + # File type + + type.register ASCIIDOC : asciidoc adoc ; + + # Define dependency scanner + + class asciidoc-scanner : common-scanner { - return "include::([^[]+)\\[" ; + rule pattern ( ) + { + return "include::([^[]+)\\[" ; + } } + + scanner.register asciidoc-scanner : include ; + type.set-scanner ASCIIDOC : asciidoc-scanner ; } -scanner.register asciidoc-scanner : include ; -type.set-scanner ASCIIDOC : asciidoc-scanner ; - # Define generators generators.register-standard asciidoctor.asciidoc-to-html : ASCIIDOC : HTML ;