Skip to content

Commit 7cb1d2f

Browse files
Bazel Contributorcopybara-github
authored andcommitted
Vendor starlark code from github.com/bazelbuild/bazel master branch
Included changes: - b08585cea8e6451d16d584ace1bafee882d88378 Eliminate all hardcoded usage of the type universe in `Mo... by brandjon <brandjon@google.com> - ed98d31d352a41595d9f4561fae501bd67a43826 Add ability for builtin methods to act as types by brandjon <brandjon@google.com> - 32eef3485d66f448df4b66fe4f0d530e1a88f99b Eliminate redundant constructor param by brandjon <brandjon@google.com> - b11068b3da3dfce20150a5365cc22d2553d3b372 Fix support for File objects in proto.encode_text by arostovtsev <arostovtsev@google.com> - b5f2b3440316106f8b770ecdc210d0c7e8409278 Rename `StarlarkClassDescriptor` -> `ClassDescriptor` by brandjon <brandjon@google.com> - 5a99b45299038d23646b0829854082fe707c9898 Encode NativeInfo via a proxy Structure to avoid dep from... by arostovtsev <arostovtsev@google.com> - 8bd966e6900e0da20854da6d4cee43c151296ec8 Update comments in `CallUtils` machinery by brandjon <brandjon@google.com> - 9bcfa7e87f1354a15f303e754347bbc6541ddc5b Add machinery for registering a Starlark value as a type ... by brandjon <brandjon@google.com> - 9fcee3ebaa1cfd59ae3ddce571788ad8410c7ff0 Type checker: Add call and conditional expression support by arostovtsev <arostovtsev@google.com> - 8f3d629275742087b262a96f56af4e16cdf9c231 Remove the version of `StarlarkValue#repr` that doesn't t... by wyv <wyv@google.com> VENDOR_STARLARK_REV_ID: b08585cea8e6451d16d584ace1bafee882d88378 Change-Id: I96ada2d54c4df85f7acc908959bcfe133ad43c38
1 parent 6f310f6 commit 7cb1d2f

38 files changed

+1070
-624
lines changed

third_party/bazel/main/java/com/google/devtools/build/lib/packages/BUILD

Lines changed: 0 additions & 18 deletions
This file was deleted.

third_party/bazel/main/java/com/google/devtools/build/lib/packages/Info.java

Lines changed: 0 additions & 71 deletions
This file was deleted.

third_party/bazel/main/java/com/google/devtools/build/lib/packages/NativeInfo.java

Lines changed: 0 additions & 144 deletions
This file was deleted.

third_party/bazel/main/java/net/starlark/java/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ filegroup(
88
"BUILD",
99
"//third_party/bazel/main/java/net/starlark/java/annot:srcs",
1010
"//third_party/bazel/main/java/net/starlark/java/eval:srcs",
11-
"//third_party/bazel/main/java/net/starlark/java/lib/json:srcs",
11+
"//third_party/bazel/main/java/net/starlark/java/lib:srcs",
1212
"//third_party/bazel/main/java/net/starlark/java/spelling:srcs",
1313
"//third_party/bazel/main/java/net/starlark/java/syntax:srcs",
1414
],

third_party/bazel/main/java/net/starlark/java/annot/StarlarkMethod.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,29 @@
190190
*/
191191
boolean useStarlarkSemantics() default false;
192192

193+
/**
194+
* Whether this method can act as a type in a type expression.
195+
*
196+
* <p>An example would be the {@code list} builtin symbol.
197+
*
198+
* <p>If true, the class identified by the Java method's return type is taken to be the Java class
199+
* whose instances are Starlark values of this Starlark type. For example, {@code list()} is
200+
* implemented by {@link MethodLibrary#list}, whose return type is {@link StarlarkList}, and
201+
* instances of {@code StarlarkList} are Starlark values of the {@code list} type.
202+
*
203+
* <p>The return type's class must define a static method with the signature:
204+
*
205+
* <pre>
206+
* public static TypeConstructor getBaseTypeConstructor() {...}
207+
* </pre>
208+
*
209+
* which is reflectively invoked to obtain an appropriate base type constructor (e.g. {@link
210+
* Types#LIST_CONSTRUCTOR}). The builtin processing machinery will wrap this base type constructor
211+
* with generated type information for the class's various {@code @StarlarkMethod}s (such as
212+
* {@code list.append}).
213+
*/
214+
boolean isTypeConstructor() default false;
215+
193216
/**
194217
* If non-empty, the annotated method will only be callable if the given semantic flag is true.
195218
* Note that at most one of {@link #enableOnlyWithFlag} and {@link #disableWithFlag} can be

0 commit comments

Comments
 (0)