aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/syntax/SkylarkNestedSet.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/syntax/SkylarkNestedSet.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/syntax/SkylarkNestedSet.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/SkylarkNestedSet.java b/src/main/java/com/google/devtools/build/lib/syntax/SkylarkNestedSet.java
index dc1e5a8618..b488bcfbf5 100644
--- a/src/main/java/com/google/devtools/build/lib/syntax/SkylarkNestedSet.java
+++ b/src/main/java/com/google/devtools/build/lib/syntax/SkylarkNestedSet.java
@@ -40,7 +40,8 @@ import javax.annotation.Nullable;
+ "to nest other sets inside of it. Examples:<br>"
+ "<pre class=language-python>s = set([1, 2])\n"
+ "s = s | [3] # s == {1, 2, 3}\n"
- + "s = s | set([4, 5]) # s == {1, 2, 3, {4, 5}}</pre>"
+ + "s = s | set([4, 5]) # s == {1, 2, 3, {4, 5}}\n"
+ + "other = set([\"a\", \"b\", \"c\"], order=\"compile\")</pre>"
+ "Note that in these examples <code>{..}</code> is not a valid literal to create sets. "
+ "Sets have a fixed generic type, so <code>set([1]) + [\"a\"]</code> or "
+ "<code>set([1]) + set([\"a\"])</code> results in an error.<br>"
@@ -48,7 +49,7 @@ import javax.annotation.Nullable;
+ "<code>map</code> or <code>dict</code>.<br>"
+ "When aggregating data from providers, sets can take significantly less memory than "
+ "other types as they support nesting, that is, their subsets are shared in memory.<br>"
- + "Every set has an <code>order</code> parameter which determines the iteration order."
+ + "Every set has an <code>order</code> parameter which determines the iteration order. "
+ "There are four possible values:"
+ "<ul><li><code>compile</code>: Defines a left-to-right post-ordering where child "
+ "elements come after those of nested sets (parent-last). For example, "
@@ -68,7 +69,7 @@ import javax.annotation.Nullable;
+ "guaranteed (<a href=\"https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/collect/nestedset/NaiveLinkOrderExpander.java#L26\">Example</a>)."
+ "</li></ul>"
+ "Except for <code>stable</code>, the above values are incompatible with each other. "
- + "Consequently, two sets can only be merged via the <code>+</code> operator or via "
+ + "Consequently, two sets can only be merged via the <code>|</code> operator or via "
+ "<code>union()</code> if either both sets have the same <code>order</code> or one of "
+ "the sets has <code>stable</code> order. In the latter case the iteration order will be "
+ "determined by the outer set, thus ignoring the <code>order</code> parameter of "