diff --git a/src/build/generators.jam b/src/build/generators.jam index 898243538..25791f190 100644 --- a/src/build/generators.jam +++ b/src/build/generators.jam @@ -44,7 +44,6 @@ # converting between given target types. import "class" : new ; -import errors ; import property-set ; import sequence ; import set ; @@ -162,17 +161,16 @@ local rule decrease-indent ( ) # class generator { - import generators : indent increase-indent decrease-indent generators.dout ; - import set ; - import utility ; + import "class" : new ; import feature ; - import errors ; + import generators : indent increase-indent decrease-indent generators.dout ; + import utility ; + import path ; + import property ; import sequence ; + import set ; import type ; import virtual-target ; - import "class" : new ; - import property ; - import path ; EXPORT class@generator : indent increase-indent decrease-indent generators.dout ; @@ -262,17 +260,17 @@ class generator { return $(self.requirements) ; } - + rule set-rule-name ( rule-name ) { self.rule-name = $(rule-name) ; } - + rule rule-name ( ) { return $(self.rule-name) ; } - + # Returns a true value if the generator can be run with the specified # properties. # @@ -319,7 +317,7 @@ class generator # Note: this does not remove any subfeatures of which # might cause problems. [ property.change $(self.requirements) : ] - $(new-toolset-properties) ] ; + $(new-toolset-properties) ] ; return $(g) ; } @@ -346,10 +344,10 @@ class generator local g = [ new $(__class__) $(self.id) $(self.composing) : $(self.source-types) : $(target-types) : $(self.requirements) ] ; if $(self.rule-name) - { + { $(g).set-rule-name $(self.rule-name) ; - } - return $(g) ; + } + return $(g) ; } # Tries to invoke this generator on the given sources. Returns a list of @@ -372,6 +370,7 @@ class generator if ! $(self.composing) && $(sources[2]) && $(self.source-types[2]) { + import errors : error : errors.error ; errors.error "Unsupported source/source-type combination" ; } @@ -471,23 +470,22 @@ class generator rule determine-target-name ( fullname : prefix ? : postfix ? ) { # See if we need to add directory to the target name. - local dir = $(fullname:D) ; - local name = $(fullname:B) ; - + local dir = $(fullname:D) ; + local name = $(fullname:B) ; + name = $(prefix:E=)$(name) ; name = $(name)$(postfix:E=) ; - if $(dir) && - # Never append '..' to target path. - ! [ MATCH .*(\\.\\.).* : $(dir) ] - && - ! [ path.is-rooted $(dir) ] + if $(dir) + # Never append '..' to target path. + && ! [ MATCH .*(\\.\\.).* : $(dir) ] + && ! [ path.is-rooted $(dir) ] { - # Relative path is always relative to the source - # directory. Retain it, so that users can have files - # with the same name in two different subdirectories. - name = $(dir)/$(name) ; - } + # Relative path is always relative to the source directory. Retain + # it, so that users can have files with the same name in two + # different subdirectories. + name = $(dir)/$(name) ; + } return $(name) ; } @@ -510,6 +508,7 @@ class generator local n2 = [ utility.basename [ $(s).name ] ] ; if $(n2) != $(name) { + import errors : error : errors.error ; errors.error "$(self.id): source targets have different names: cannot determine target name" ; } } @@ -697,7 +696,7 @@ class generator rule register ( g ) { .all-generators += $(g) ; - + # A generator can produce several targets of the same type. We want unique # occurrence of that generator in .generators.$(t) in that case, otherwise, # it will be tried twice and we will get a false ambiguity. @@ -1082,6 +1081,7 @@ local rule ensure-type ( targets * ) { if ! [ $(t).type ] { + import errors ; errors.error "target" [ $(t).str ] "has no type" ; } } @@ -1194,7 +1194,7 @@ rule find-viable-generators ( target-type : property-set ) else { generators.dout [ indent ] " generator " [ $(g).id ] "is active, discaring" ; - } + } } # Generators which override 'all'. @@ -1313,7 +1313,7 @@ rule construct ( project name ? : target-type : property-set * : sources * : top saved-active = $(.active-generators) ; .active-generators = ; } - + if (.construct-stack) { ensure-type $(sources) ; @@ -1340,7 +1340,7 @@ rule construct ( project name ? : target-type : property-set * : sources * : top decrease-indent ; .construct-stack = $(.construct-stack[2-]) ; - + if $(top-level) { .active-generators = $(saved-active) ; @@ -1374,7 +1374,7 @@ rule dump ( ) { for local g in $(.all-generators) { - ECHO [ $(g).id ] ":" [ $(g).source-types ] -> [ $(g).target-types ] ; - } + ECHO [ $(g).id ] ":" [ $(g).source-types ] -> [ $(g).target-types ] ; + } } diff --git a/src/build/project.jam b/src/build/project.jam index f522431c1..34c062ce1 100644 --- a/src/build/project.jam +++ b/src/build/project.jam @@ -35,7 +35,6 @@ # their project id. import "class" : new ; -import errors ; import modules ; import path ; import print ; @@ -124,6 +123,7 @@ rule act-as-jamfile ( module : location ) { if [ module-name $(location) ] in $(.jamfile-modules) { + import errors ; errors.error "Jamfile was already loaded for '$(location)'" ; } # Set up non-default mapping from location to module. @@ -207,8 +207,8 @@ JAMFILE ?= [Bb]uild.jam [Jj]amfile.v2 [Jj]amfile [Jj]amfile.jam ; # directory given in it. # rule find-jamfile ( - dir # The directory(s) to look for a Jamfile. - parent-root ? # Optional flag indicating to search for the parent Jamfile. + dir # The directory(s) to look for a Jamfile. + parent-root ? # Optional flag indicating to search for the parent Jamfile. : no-errors ? ) { @@ -261,6 +261,7 @@ rule find-jamfile ( # if ! $(no-errors) && ! $(jamfile-to-load) { + import errors ; errors.error Unable to load Jamfile. : Could not find a Jamfile in directory '$(dir)'. : Attempted to find it with pattern '$(JAMFILE:J=" ")'. @@ -290,8 +291,9 @@ local rule load-jamfile ( if $(jamfile-to-load[2]) { - errors.error "Multiple Jamfiles found at '$(dir)'" - : "Filenames are: " $(jamfile-to-load:D=) ; + import errors ; + errors.error "Multiple Jamfiles found at '$(dir)'" : + "Filenames are: " $(jamfile-to-load:D=) ; } # Now load the Jamfile in it's own context. @@ -327,12 +329,14 @@ local rule load-jamfile ( # Now do some checks. if $(.current-project) != $(saved-project) { - errors.error "The value of the .current-project variable has magically" - : "changed after loading a Jamfile. This means some of the targets" - : "might be defined in the wrong project." - : "after loading" $(jamfile-module) - : "expected value" $(saved-project) - : "actual value" $(.current-project) ; + import errors ; + errors.error + The value of the .current-project variable has magically + : changed after loading a Jamfile. This means some of the + : targets might be defined in the wrong project. + : after loading $(jamfile-module) + : expected value $(saved-project) + : actual value $(.current-project) ; } if $(.global-build-dir) @@ -479,6 +483,7 @@ rule initialize ( local s = [ modules.binding $(module-name) ] ; if ! $(s) { + import errors ; errors.error "Could not determine project location $(module-name)" ; } $(attributes).set source-location : $(s:D) : exact ; @@ -584,7 +589,6 @@ class project-attributes { import property ; import property-set ; - import errors ; import path ; import print ; import sequence ; @@ -615,13 +619,12 @@ class project-attributes if $(result[1]) = "@error" { + import errors : error : errors.error ; errors.error Requirements for project at '$(self.location)' conflict with parent's. : Explanation: $(result[2-]) ; } - else - { - self.requirements = $(result) ; - } + + self.requirements = $(result) ; } else if $(attribute) = "usage-requirements" { @@ -636,6 +639,7 @@ class project-attributes local non-free = [ property.remove free : $(unconditional) ] ; if $(non-free) { + import errors : error : errors.error ; errors.error usage-requirements $(specification) have non-free properties $(non-free) ; } @@ -678,6 +682,7 @@ class project-attributes else if ! $(attribute) in "default-build" "location" "parent" "projects-to-build" "project-root" "source-location" { + import errors : error : errors.error ; errors.error Invalid project attribute '$(attribute)' specified for project at '$(self.location)' ; } @@ -783,6 +788,7 @@ rule use ( id : location ) if $($(id).jamfile-module) && ( $($(id).jamfile-module) != $(project-module) ) { + import errors ; errors.user-error Attempt to redeclare already existing project id '$(id)' location '$(location)' ; @@ -921,7 +927,6 @@ module project-rules rule project ( id ? : options * : * ) { - import errors ; import path ; import project ; @@ -969,6 +974,7 @@ module project-rules if $(explicit-build-dir) && [ path.is-rooted $(explicit-build-dir) ] { + import errors ; errors.user-error Absolute directory specified via 'build-dir' project attribute : Do not know how to combine that with the --build-dir option. ; @@ -986,6 +992,7 @@ module project-rules # Not Jamroot. if $(explicit-build-dir) { + import errors ; errors.user-error When --build-dir is specified, the 'build-dir' project : attribute is allowed only for top-level 'project' invocations ; @@ -1080,6 +1087,7 @@ module project-rules if $(wildcards:D) || $(excludes:D) { + import errors ; errors.user-error The patterns to 'glob-tree' may not include directory ; } diff --git a/src/engine/builtins.c b/src/engine/builtins.c index cd5bc7e9d..7c57f097e 100644 --- a/src/engine/builtins.c +++ b/src/engine/builtins.c @@ -247,7 +247,6 @@ void load_builtins() builtin_rulenames, 0, args ); } - { char const * args[] = { "module", "?", 0 }; bind_builtin( "VARNAMES", @@ -1473,11 +1472,11 @@ LIST * builtin_update_now( FRAME * frame, int flags ) LIST * builtin_import_module( FRAME * frame, int flags ) { - LIST * arg1 = lol_get( frame->args, 0 ); - LIST * arg2 = lol_get( frame->args, 1 ); - module_t * m = !list_empty( arg2 ) - ? bindmodule( list_front( arg2 ) ) - : root_module(); + LIST * const arg1 = lol_get( frame->args, 0 ); + LIST * const arg2 = lol_get( frame->args, 1 ); + module_t * const m = list_empty( arg2 ) + ? root_module() + : bindmodule( list_front( arg2 ) ); import_module( arg1, m ); return L0; } diff --git a/src/engine/modules.c b/src/engine/modules.c index 8898d18bb..5c1036d81 100644 --- a/src/engine/modules.c +++ b/src/engine/modules.c @@ -4,30 +4,29 @@ * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) */ #include "jam.h" - #include "modules.h" -#include "string.h" + #include "hash.h" -#include "object.h" #include "lists.h" +#include "native.h" +#include "object.h" #include "parse.h" #include "rules.h" -#include "variable.h" #include "strings.h" -#include "native.h" +#include "variable.h" + #include +#include static struct hash * module_hash = 0; static module_t root; + module_t * bindmodule( OBJECT * name ) { - if ( !name ) - { return &root; - } - else + { PROFILE_ENTER( BINDMODULE ); @@ -58,6 +57,7 @@ module_t * bindmodule( OBJECT * name ) } } + /* * demand_rules() - Get the module's "rules" hash on demand. */ @@ -93,6 +93,7 @@ static void delete_imported_modules( void * xmodule_name, void * data ) object_free( *(OBJECT * *)xmodule_name ); } + static void free_fixed_variable( void * xvar, void * data ); void delete_module( module_t * m ) @@ -258,7 +259,7 @@ void modules_done() hashenumerate( class_hash, print_class_stats, (void *)0 ); hash_free( class_hash ); } - hashenumerate( module_hash, delete_module_, (void *)0 ); + hashenumerate( module_hash, delete_module_, (void *)0 ); hashdone( module_hash ); module_hash = 0; delete_module( &root ); @@ -275,22 +276,23 @@ void import_module( LIST * module_names, module_t * target_module ) PROFILE_ENTER( IMPORT_MODULE ); struct hash * h; - LISTITER iter, end; + LISTITER iter; + LISTITER end; if ( !target_module->imported_modules ) - target_module->imported_modules = hashinit( sizeof( char * ), "imported" ); + target_module->imported_modules = hashinit( sizeof( char * ), "imported" + ); h = target_module->imported_modules; - iter = list_begin( module_names ), end = list_end( module_names ); + iter = list_begin( module_names ); + end = list_end( module_names ); for ( ; iter != end; iter = list_next( iter ) ) { int found; - OBJECT * s = list_item( iter ); - OBJECT * * ss = (OBJECT * *)hash_insert( h, s, &found ); - if( !found ) - { + OBJECT * const s = list_item( iter ); + OBJECT * * const ss = (OBJECT * *)hash_insert( h, s, &found ); + if ( !found ) *ss = object_copy( s ); - } } PROFILE_EXIT( IMPORT_MODULE ); @@ -299,9 +301,8 @@ void import_module( LIST * module_names, module_t * target_module ) static void add_module_name( void * r_, void * result_ ) { - OBJECT * * r = (OBJECT * *)r_; - LIST * * result = (LIST * *)result_; - + OBJECT * * const r = (OBJECT * *)r_; + LIST * * const result = (LIST * *)result_; *result = list_push_back( *result, object_copy( *r ) ); } @@ -315,8 +316,8 @@ LIST * imported_modules( module_t * module ) } -FUNCTION * function_bind_variables( FUNCTION * f, module_t * module, int * counter ); -FUNCTION * function_unbind_variables( FUNCTION * f ); +FUNCTION * function_bind_variables( FUNCTION *, module_t *, int * counter ); +FUNCTION * function_unbind_variables( FUNCTION * ); struct fixed_variable { @@ -330,19 +331,23 @@ struct bind_vars_t int counter; }; + static void free_fixed_variable( void * xvar, void * data ) { object_free( ( (struct fixed_variable *)xvar )->key ); } + static void bind_variables_for_rule( void * xrule, void * xdata ) { RULE * rule = (RULE *)xrule; struct bind_vars_t * data = (struct bind_vars_t *)xdata; if ( rule->procedure && rule->module == data->module ) - rule->procedure = function_bind_variables( rule->procedure, data->module, &data->counter ); + rule->procedure = function_bind_variables( rule->procedure, + data->module, &data->counter ); } + void module_bind_variables( struct module_t * m ) { if ( m != root_module() && m->rules ) @@ -355,6 +360,7 @@ void module_bind_variables( struct module_t * m ) } } + int module_add_fixed_var( struct module_t * m, OBJECT * name, int * counter ) { struct fixed_variable * v; @@ -375,6 +381,7 @@ int module_add_fixed_var( struct module_t * m, OBJECT * name, int * counter ) return v->n; } + LIST * var_get_and_clear_raw( module_t * m, OBJECT * name ); static void load_fixed_variable( void * xvar, void * data ) @@ -382,11 +389,10 @@ static void load_fixed_variable( void * xvar, void * data ) struct fixed_variable * var = (struct fixed_variable *)xvar; struct module_t * m = (struct module_t *)data; if ( var->n >= m->num_fixed_variables ) - { m->fixed_variables[ var->n ] = var_get_and_clear_raw( m, var->key ); - } } + void module_set_fixed_variables( struct module_t * m, int n_variables ) { /* Reallocate */ @@ -398,39 +404,26 @@ void module_set_fixed_variables( struct module_t * m, int n_variables ) BJAM_FREE( m->fixed_variables ); } m->fixed_variables = fixed_variables; - if ( m->class_module ) - { - variable_indices = m->class_module->variable_indices; - } - else - { - variable_indices = m->variable_indices; - } + variable_indices = m->class_module + ? m->class_module->variable_indices + : m->variable_indices; if ( variable_indices ) hashenumerate( variable_indices, &load_fixed_variable, m ); m->num_fixed_variables = n_variables; } + int module_get_fixed_var( struct module_t * m_, OBJECT * name ) { struct fixed_variable * v; struct module_t * m = m_; if ( m->class_module ) - { m = m->class_module; - } if ( !m->variable_indices ) return -1; v = (struct fixed_variable *)hash_find( m->variable_indices, name ); - if ( v && v->n < m_->num_fixed_variables ) - { - return v->n; - } - else - { - return -1; - } + return v && v->n < m_->num_fixed_variables ? v->n : -1; } diff --git a/src/engine/modules.h b/src/engine/modules.h index a7d9752b8..1b161c6e5 100644 --- a/src/engine/modules.h +++ b/src/engine/modules.h @@ -4,10 +4,12 @@ * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) */ #ifndef MODULES_DWA10182001_H -# define MODULES_DWA10182001_H +#define MODULES_DWA10182001_H #include "lists.h" +#include "object.h" +typedef struct module_t module_t ; struct module_t { OBJECT * name; @@ -17,37 +19,34 @@ struct module_t int num_fixed_variables; LIST * * fixed_variables; struct hash * imported_modules; - struct module_t * class_module; + module_t * class_module; struct hash * native_rules; int user_module; }; -typedef struct module_t module_t ; /* MSVC debugger gets confused unless this is provided */ - module_t * bindmodule( OBJECT * name ); module_t * root_module(); void delete_module( module_t * ); void import_module( LIST * module_names, module_t * target_module ); -LIST* imported_modules(module_t* module); +LIST * imported_modules( module_t * ); struct hash * demand_rules( module_t * ); -void module_bind_variables( struct module_t * m ); +void module_bind_variables( module_t * ); /* - * After calling module_add_fixed_var, module_set_fixed_variables - * must be called before accessing any variables in the module. + * After calling module_add_fixed_var, module_set_fixed_variables must be called + * before accessing any variables in the module. */ -int module_add_fixed_var( struct module_t * m, OBJECT * name, int * n ); -void module_set_fixed_variables( struct module_t * m, int n ); +int module_add_fixed_var( module_t *, OBJECT * name, int * n ); +void module_set_fixed_variables( module_t *, int n ); /* * Returns the index of the variable or -1 if none exists. */ -int module_get_fixed_var( struct module_t * m, OBJECT * name ); +int module_get_fixed_var( module_t *, OBJECT * name ); void modules_done(); #endif - diff --git a/src/engine/subst.c b/src/engine/subst.c index 156670f1e..42cd6f035 100644 --- a/src/engine/subst.c +++ b/src/engine/subst.c @@ -1,97 +1,103 @@ -#include #include "jam.h" -#include "regexp.h" -#include "hash.h" -#include "object.h" -#include "lists.h" +#include "builtins.h" #include "compile.h" #include "frames.h" -#include "builtins.h" +#include "hash.h" +#include "lists.h" +#include "object.h" +#include "regexp.h" + +#include + struct regex_entry { - OBJECT* pattern; - regexp* regex; + OBJECT * pattern; + regexp * regex; }; typedef struct regex_entry regex_entry; -static struct hash* regex_hash; +static struct hash * regex_hash; -regexp* regex_compile( OBJECT* pattern ) + +regexp * regex_compile( OBJECT * pattern ) { int found; regex_entry * e ; if ( !regex_hash ) - regex_hash = hashinit(sizeof(regex_entry), "regex"); + regex_hash = hashinit( sizeof( regex_entry ), "regex" ); e = (regex_entry *)hash_insert( regex_hash, pattern, &found ); if ( !found ) { e->pattern = object_copy( pattern ); - e->regex = regcomp( (char*)pattern ); + e->regex = regcomp( (char *)pattern ); } return e->regex; } + LIST * builtin_subst( FRAME * frame, int flags ) { - LIST* result = L0; - LIST* arg1 = lol_get( frame->args, 0 ); - LISTITER iter = list_begin( arg1 ), end = list_end( arg1 ); + LIST * result = L0; + LIST * const arg1 = lol_get( frame->args, 0 ); + LISTITER iter = list_begin( arg1 ); + LISTITER const end = list_end( arg1 ); - if ( iter != end && list_next( iter ) != end && list_next( list_next( iter ) ) != end ) - { + if ( iter != end && list_next( iter ) != end && list_next( list_next( iter ) + ) != end ) + { + char const * const source = object_str( list_item( iter ) ); + OBJECT * const pattern = list_item( list_next( iter ) ); + regexp * const repat = regex_compile( pattern ); - const char* source = object_str( list_item( iter ) ); - OBJECT * pattern = list_item( list_next( iter ) ); - regexp* repat = regex_compile( pattern ); + if ( regexec( repat, (char *)source) ) + { + LISTITER subst = list_next( iter ); - if ( regexec( repat, (char*)source) ) - { - LISTITER subst = list_next( iter ); + while ( ( subst = list_next( subst ) ) != end ) + { +#define BUFLEN 4096 + char buf[ BUFLEN + 1 ]; + char const * in = object_str( list_item( subst ) ); + char * out = buf; - while ( ( subst = list_next( subst ) ) != end ) - { -# define BUFLEN 4096 - char buf[BUFLEN + 1]; - const char* in = object_str( list_item( subst ) ); - char* out = buf; + for ( ; *in && out < buf + BUFLEN; ++in ) + { + if ( *in == '\\' || *in == '$' ) + { + ++in; + if ( *in == 0 ) + break; + if ( *in >= '0' && *in <= '9' ) + { + unsigned int const n = *in - '0'; + size_t const srclen = repat->endp[ n ] - + repat->startp[ n ]; + size_t const remaining = buf + BUFLEN - out; + size_t const len = srclen < remaining + ? srclen + : remaining; + memcpy( out, repat->startp[ n ], len ); + out += len; + continue; + } + /* fall through and copy the next character */ + } + *out++ = *in; + } + *out = 0; - for ( ; *in && out < buf + BUFLEN; ++in ) - { - if ( *in == '\\' || *in == '$' ) - { - ++in; - if ( *in == 0 ) - { - break; - } - else if ( *in >= '0' && *in <= '9' ) - { - unsigned n = *in - '0'; - const size_t srclen = repat->endp[n] - repat->startp[n]; - const size_t remaining = buf + BUFLEN - out; - const size_t len = srclen < remaining ? srclen : remaining; - memcpy( out, repat->startp[n], len ); - out += len; - continue; - } - /* fall through and copy the next character */ - } - *out++ = *in; - } - *out = 0; - - result = list_push_back( result, object_new( buf ) ); + result = list_push_back( result, object_new( buf ) ); #undef BUFLEN - } - } - } + } + } + } - return result; + return result; } diff --git a/src/kernel/errors.jam b/src/kernel/errors.jam index 63b11e867..88f620b5f 100644 --- a/src/kernel/errors.jam +++ b/src/kernel/errors.jam @@ -13,8 +13,8 @@ rule backtrace ( skip-frames prefix messages * : * ) local drop-elements = $(frame-skips[$(skip-frames)]) ; if ! ( $(skip-frames) in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ) { - ECHO "warning: backtrace doesn't support skipping $(skip-frames) frames;" - "using 1 instead." ; + ECHO "warning: backtrace doesn't support skipping $(skip-frames) " + "frames; using 1 instead." ; drop-elements = 5 ; } @@ -25,7 +25,7 @@ rule backtrace ( skip-frames prefix messages * : * ) ECHO "$(prefix) at $(bt) " ; for local n in $(args) { - if $($(n))-is-not-empty + if $($(n))-is-defined { ECHO $(prefix) $($(n)) ; } @@ -46,7 +46,7 @@ rule backtrace ( skip-frames prefix messages * : * ) # The first time through, print each argument on a separate line. for local n in $(args) { - if $($(n))-is-not-empty + if $($(n))-is-defined { ECHO $(prefix) $($(n)) ; } @@ -89,7 +89,7 @@ rule catch ( messages * : * ) import sequence ; - if ! $(.last-error-$(.args))-is-not-empty + if ! $(.last-error-$(.args))-is-defined { error-skip-frames 3 expected an error, but none occurred ; } @@ -123,8 +123,8 @@ rule error-skip-frames ( skip-frames messages * : * ) { for local n in $(.args) { - # Add an extra empty string so that we always have - # something in the event of an error + # Add an extra empty string so that we always have something in the + # event of an error. .last-error-$(n) = $($(n)) "" ; } } @@ -142,10 +142,11 @@ rule error ( messages * : * ) { if $(.no-error-backtrace) { + local first-printed ; # Print each argument on a separate line. for local n in $(.args) { - if $($(n))-is-not-empty + if $($(n))-is-defined { if ! $(first-printed) { @@ -162,7 +163,8 @@ rule error ( messages * : * ) } else { - error-skip-frames 3 $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ; + error-skip-frames 3 $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : + $(8) : $(9) ; } } @@ -172,7 +174,8 @@ rule error ( messages * : * ) rule user-error ( messages * : * ) { .user-modules-only = 1 ; - error-skip-frames 3 $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ; + error-skip-frames 3 $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : + $(9) ; } @@ -180,7 +183,8 @@ rule user-error ( messages * : * ) # rule warning { - backtrace 2 warning: $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ; + backtrace 2 warning: $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : + $(9) ; } diff --git a/src/kernel/modules.jam b/src/kernel/modules.jam index 1f75354fc..8f3b78cbe 100644 --- a/src/kernel/modules.jam +++ b/src/kernel/modules.jam @@ -46,7 +46,8 @@ local rule run-module-test ( m ) } local test-module = __test-$(m)__ ; - IMPORT $(m) : [ RULENAMES $(m) ] : $(test-module) : [ RULENAMES $(m) ] ; + IMPORT $(m) : [ RULENAMES $(m) ] : $(test-module) : [ RULENAMES $(m) + ] ; IMPORT $(m) : __test__ : $(test-module) : __test__ : LOCALIZE ; module $(test-module) { @@ -260,8 +261,8 @@ rule import ( module-names + : rules-opt * : rename-opt * ) { if ! $(m) in $(.loaded) { - # If the importing module isn't already in the BOOST_BUILD_PATH, - # prepend it to the path. We don't want to invert the search order + # If the importing module is not already in the BOOST_BUILD_PATH, + # prepend it to the path. We do not want to invert the search order # of modules that are already there. local caller-location ; @@ -269,7 +270,8 @@ rule import ( module-names + : rules-opt * : rename-opt * ) { caller-location = [ binding $(caller) ] ; caller-location = $(caller-location:D) ; - caller-location = [ normalize-raw-paths $(caller-location:R=$(.cwd)) ] ; + caller-location = [ normalize-raw-paths + $(caller-location:R=$(.cwd)) ] ; } local search = [ peek : BOOST_BUILD_PATH ] ; @@ -312,11 +314,10 @@ rule import ( module-names + : rules-opt * : rename-opt * ) # rule clone-rules ( source-module target-module ) { - local rules = [ RULENAMES $(source-module) ] ; - - IMPORT $(source-module) : $(rules) : $(target-module) : $(rules) : LOCALIZE ; - EXPORT $(target-module) : $(rules) ; - IMPORT $(target-module) : $(rules) : : $(target-module).$(rules) ; + local r = [ RULENAMES $(source-module) ] ; + IMPORT $(source-module) : $(r) : $(target-module) : $(r) : LOCALIZE ; + EXPORT $(target-module) : $(r) ; + IMPORT $(target-module) : $(r) : : $(target-module).$(r) ; } diff --git a/test/generators-test/jamroot.jam b/test/generators-test/jamroot.jam index 95eeffd4f..65705d236 100644 --- a/test/generators-test/jamroot.jam +++ b/test/generators-test/jamroot.jam @@ -66,7 +66,7 @@ appender.register ui-to-h : tUI : tUI_H ; ################################################################################ type.register X1 : x1 ; -type.register X2 : x2 ; +type.register X2 : x2 ; type.register X_PRO : x_pro ; appender.register x1-x2-to-cpp : X1 X2 : CPP ;