diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skylarkinterface/Param.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skylarkinterface/Param.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skylarkinterface/Param.java b/src/main/java/com/google/devtools/build/lib/skylarkinterface/Param.java index 845cb27963..4bbf10ad5d 100644 --- a/src/main/java/com/google/devtools/build/lib/skylarkinterface/Param.java +++ b/src/main/java/com/google/devtools/build/lib/skylarkinterface/Param.java @@ -67,6 +67,23 @@ public @interface Param { */ boolean noneable() default false; + /** + * If true, the parameter may be specified as a named parameter. For example for an integer named + * parameter {@code foo} of a method {@code bar}, then the method call will look like + * {@code foo(bar=1)}. + */ + boolean named() default false; + + /** + * If true, the parameter may be specified as a positional parameter. For example for an integer + * positional parameter {@code foo} of a method {@code bar}, then the method call will look like + * {@code foo(1)}. If {@link #named()} is {@code false}, then this will be the only way to call + * {@code foo}. + * + * <p>Positional arguments should comes first. + */ + boolean positional() default true; + // TODO(bazel-team): parse the type from a single field in Skylark syntax, // and allow a Union as "ThisType or ThatType or NoneType": // String type() default "Object"; |