2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-15 13:02:11 +00:00

Minor stylistic changes in different Boost Build scripts.

[SVN r47344]
This commit is contained in:
Jurko Gospodnetić
2008-07-12 11:33:16 +00:00
parent e61db8f60a
commit 24034a4344
2 changed files with 34 additions and 30 deletions

View File

@@ -28,7 +28,7 @@ rule refine ( properties * : requirements * )
# them so that we can handle 'properties'.
for local r in $(requirements)
{
# Don't consider conditional requirements.
# Do not consider conditional requirements.
if ! [ MATCH (:) : $(r:G=) ]
{
# Note: cannot use a local variable here, so use an ugly name.
@@ -149,9 +149,12 @@ rule expand-subfeatures-in-conditions ( properties * )
# passing 'true' as the second parameter.
e += [ feature.expand-subfeatures $(c) : true ] ;
}
if $(e) = $(condition)
{
# (todo)
# This is just an optimization and possibly a premature one at
# that.
# (todo) (12.07.2008.) (Jurko)
result += $(p) ;
}
else
@@ -229,10 +232,10 @@ rule as-path ( properties * )
if ! $($(entry))
{
# trim redundancy
# Trim redundancy.
properties = [ feature.minimize $(properties) ] ;
# sort according to path-order
# Sort according to path-order.
properties = [ sequence.insertion-sort $(properties) : path-order ] ;
local components ;
@@ -510,7 +513,7 @@ rule translate-indirect ( specification * : context-module )
}
# Class which maintains a property set -> string mapping.
# Class maintaining a property set -> string mapping.
#
class property-map
{
@@ -536,7 +539,7 @@ class property-map
# Returns the value associated with 'properties' or any subset of it. If
# more than one subset has a value assigned to it, returns the value for the
# longest subset, if it's unique.
# longest subset, if it is unique.
#
rule find ( properties + )
{
@@ -548,7 +551,7 @@ class property-map
#
rule find-replace ( properties + : value ? )
{
# First find all matches
# First find all matches.
local matches ;
local match-ranks ;
for local i in $(self.all-flags)

View File

@@ -1,17 +1,17 @@
# Copyright 2001, 2002 Dave Abrahams
# Copyright 2003 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Copyright 2001, 2002 Dave Abrahams
# Copyright 2003 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# difference
# returns the elements of B that are not in A
rule difference ( B * : A * )
# Returns the elements of set1 that are not in set2.
#
rule difference ( set1 * : set2 * )
{
local result = ;
local element ;
for element in $(B)
for local element in $(set1)
{
if ! ( $(element) in $(A) )
if ! ( $(element) in $(set2) )
{
result += $(element) ;
}
@@ -21,9 +21,9 @@ rule difference ( B * : A * )
NATIVE_RULE set : difference ;
# intersection set1 : set2
# Removes all the items appearing in both set1 & set2.
#
# Removes from set1 any items which don't appear in set2 and returns the result.
rule intersection ( set1 * : set2 * )
{
local result ;
@@ -37,6 +37,10 @@ rule intersection ( set1 * : set2 * )
return $(result) ;
}
# Returns whether set1 & set2 contain the same elements. Note that this ignores
# any element ordering differences as well as any element duplication.
#
rule equal ( set1 * : set2 * )
{
if $(set1) in $(set2) && ( $(set2) in $(set1) )
@@ -45,18 +49,15 @@ rule equal ( set1 * : set2 * )
}
}
rule __test__ ( )
{
import assert ;
assert.result 0 1 4 6 8 9
: difference 0 1 2 3 4 5 6 7 8 9 : 2 3 5 7 ;
assert.result 2 5 7 : intersection 0 1 2 4 5 6 7 8 9 : 2 3 5 7 ;
assert.true equal 1 1 2 3 : 3 2 2 1 ;
assert.false equal 2 3 : 3 2 2 1 ;
assert.result 0 1 4 6 8 9 : difference 0 1 2 3 4 5 6 7 8 9 : 2 3 5 7 ;
assert.result 2 5 7 : intersection 0 1 2 4 5 6 7 8 9 : 2 3 5 7 ;
assert.true equal : ;
assert.true equal 1 1 2 3 : 3 2 2 1 ;
assert.false equal 2 3 : 3 2 2 1 ;
}