|
Boost-Commit : |
From: jurko.gospodnetic_at_[hidden]
Date: 2008-07-12 07:33:17
Author: jurko
Date: 2008-07-12 07:33:16 EDT (Sat, 12 Jul 2008)
New Revision: 47344
URL: http://svn.boost.org/trac/boost/changeset/47344
Log:
Minor stylistic changes in different Boost Build scripts.
Text files modified:
trunk/tools/build/v2/build/property.jam | 17 ++++++++-----
trunk/tools/build/v2/util/set.jam | 47 ++++++++++++++++++++-------------------
2 files changed, 34 insertions(+), 30 deletions(-)
Modified: trunk/tools/build/v2/build/property.jam
==============================================================================
--- trunk/tools/build/v2/build/property.jam (original)
+++ trunk/tools/build/v2/build/property.jam 2008-07-12 07:33:16 EDT (Sat, 12 Jul 2008)
@@ -28,7 +28,7 @@
# 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 @@
# 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 @@
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 @@
}
-# Class which maintains a property set -> string mapping.
+# Class maintaining a property set -> string mapping.
#
class property-map
{
@@ -536,7 +539,7 @@
# 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 @@
#
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)
Modified: trunk/tools/build/v2/util/set.jam
==============================================================================
--- trunk/tools/build/v2/util/set.jam (original)
+++ trunk/tools/build/v2/util/set.jam 2008-07-12 07:33:16 EDT (Sat, 12 Jul 2008)
@@ -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)
-
-# difference
-# returns the elements of B that are not in A
-rule difference ( B * : A * )
+# 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)
+
+
+# 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 @@
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 @@
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 __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 ;
+}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk