| Commit message (Collapse) | Author | Age |
... | |
|
|
|
|
| |
RELNOTES: None
PiperOrigin-RevId: 164457611
|
|
|
|
|
|
|
| |
I.e., ('a', 'b') * 3 == ('a', 'b', 'a', 'b', 'a', 'b'), like lists.
RELNOTES: None
PiperOrigin-RevId: 164403099
|
|
|
|
|
|
|
|
|
| |
Previously, you could modify a frozen MutableList indirectly via its iterator(). This CL wraps the underlying list with a Collections.unmodifiableList when obtaining the iterator, and likewise for other methods that return views over Skylark data structures.
This also eliminates the SkylarkList#getContents method in favor of just using the SkylarkList object itself.
RELNOTES: None
PiperOrigin-RevId: 164402129
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On the subject of simpler toString output (i.e. "selector" vs.
"selector({dictionary contents here})", I'm not changing that here
because there are consistency concerns. BuildType.SelectorList.toString
is defined to match lib.syntax.SelectorList's Skylark serialization.
That follows a standard pattern defined here:
https://github.com/bazelbuild/bazel/blob/67bd6fc6354f2abbbc149fcd0120228b538842d3/src/main/java/com/google/devtools/build/lib/skylarkinterface/SkylarkValue.java#L37
which has concerns about deserialization. If you want to take this further
we can discuss with the Skylark devs.
PiperOrigin-RevId: 164311511
|
|
|
|
|
|
|
| |
No need for the intermediate collection/objects when we can go direct to ImmutableList,
which has a good chance of doing something more efficient anyway...
PiperOrigin-RevId: 164295659
|
|
|
|
|
|
|
| |
No need for the intermediate collection/objects when we can go direct to ImmutableList,
which has a good chance of doing something more efficient anyway...
PiperOrigin-RevId: 164294883
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Made abstract collection classes in SkylarkMutable more systematic. Added javadoc. Added a BaseMutableList class to factor out List stubs from SkylarkList. Alphabetized the methods to make it easier to verify that all overrides are covered.
- Simplified MutableList constructors. Added MutableList#copyOf factory, and deprecated public access to the existing constructor to be more in line with Guava collections. Made Tuple#create private.
- Made mutation methods for MutableList take in mutabilities rather than environments. For symmetry with the other mutators, pushed SkylarkList#set down to MutableList and moved the evaluation of its index to the caller.
- Made SkylarkList#getSlice an abstract method that's implemented symmetrically in Tuple and MutableList -- instead of the bizarre thing it was doing before, where its return type was a List that sometimes got passed through SkylarkType.convertToSkylark in the caller.
- Removed final modifier on methods where it wasn't obviously appropriate. Removed redundant super() calls. Renamed type variables to always be one letter, and to not reuse the instance's own type variable name from within static methods.
RELNOTES: None
PiperOrigin-RevId: 164257778
|
|
|
|
|
| |
RELNOTES: None
PiperOrigin-RevId: 164131012
|
|
|
|
|
| |
RELNOTES: None.
PiperOrigin-RevId: 164102319
|
|
|
|
|
|
|
|
|
| |
Also throw IllegalArgumentException instead of AssertionError.
A follow-up CL will look to eliminate the SkylarkMutable#checkMutable(Location, Environment) override in favor of checkMutable(Location, Mutability). This will make it easier to manipulate Skylark values in specialized contexts aside from normal evaluation.
RELNOTES: None
PiperOrigin-RevId: 163978262
|
|
|
|
|
|
|
| |
I.e., use an accessor for type inference. The EMPTY field will be made private in a future CL.
RELNOTES: None
PiperOrigin-RevId: 163843569
|
|
|
|
|
|
|
| |
Also fix minor bug where a[b] += c would evaluate b twice.
RELNOTES: None
PiperOrigin-RevId: 163103618
|
|
|
|
|
|
|
|
|
| |
This is a temporary flag that causes Extension objects to elide some built-in symbols, for the benefit of tests. Currently it only applies to the "native" builtin for Extensions created by SkylarkImportLookupFunction.
A future Skylark language change will have the effect of excluding all builtin symbols from all Extension objects anyway, so this flag will eventually be subsumed by that incompatible change.
RELNOTES: None
PiperOrigin-RevId: 163016504
|
|
|
|
|
| |
RELNOTES: None.
PiperOrigin-RevId: 162623144
|
|
|
|
|
|
| |
links to "deptset" and "list".
PiperOrigin-RevId: 162607082
|
|
|
|
|
| |
RELNOTES: None.
PiperOrigin-RevId: 162518452
|
|
|
|
|
| |
RELNOTES: None.
PiperOrigin-RevId: 162505701
|
|
|
|
|
| |
RELNOTES: None.
PiperOrigin-RevId: 162475651
|
|
|
|
|
|
|
| |
Add value-class methods to SkylarkFileDependency and SkylarkImportLookupValue. Remove Java serialization hack from Extension.
RELNOTES: None
PiperOrigin-RevId: 162383283
|
|
|
|
|
|
|
| |
The option filters proto dependency can be removed from the OptionsParser. This is in response to option parser users that want to avoid the bazel-internal proto file in their dependencies.
RELNOTES: None.
PiperOrigin-RevId: 162249778
|
|
|
|
|
| |
RELNOTES: None
PiperOrigin-RevId: 162135034
|
|
|
|
|
|
|
|
| |
Don't call the `toString` method on unknown objects as it potentially
breaks hermeticity and determinism. Use a generic string like
"<unknown object package.ClassName>" instead.
PiperOrigin-RevId: 161970449
|
|
|
|
|
|
|
| |
Also refactor FAIL_FAST_HANDLER to throw something more specific than IllegalArgumentException. This bug was masked because the test assertion that would've caught it considered IllegalArgumentException to be an expected error, the same as EvalException.
RELNOTES: None
PiperOrigin-RevId: 161809957
|
|
|
|
|
| |
RELNOTES: None.
PiperOrigin-RevId: 161706309
|
|
|
|
|
|
| |
*** Reason for rollback ***
PiperOrigin-RevId: 161567104
|
|
|
|
|
| |
RELNOTES: None
PiperOrigin-RevId: 161560683
|
|
|
|
|
|
|
|
|
| |
- changed field names and a couple accessors to consistently use full words ("statement" instead of "stmt")
- applied several local analyzers (from IntelliJ) to remove redundant modifiers, unnecessary explicit types (yay Java 8), etc.
RELNOTES: None
PiperOrigin-RevId: 161551096
|
|
|
|
|
|
|
|
| |
Don't call the `toString` method on unknown objects as it potentially
breaks hermeticity and determinism. Use a generic string like
"<unknown object package.ClassName>" instead.
PiperOrigin-RevId: 161544828
|
|
|
|
|
|
|
|
|
| |
to use.
Part of #2219.
Change-Id: Id6dfe6ec102f609bb19461242a098bf977be29ae
PiperOrigin-RevId: 161527986
|
|
|
|
|
|
|
|
|
| |
Skylark's Printer.BasePrinter doesn't guarantee it will call `.toString` on
objects of unknown types, and in the future that won't be the case anymore.
In order to keep their current string representations objects should implement
the SkylarkValue interface by providing an explicit implementation of `repr`.
PiperOrigin-RevId: 161526182
|
|
|
|
|
|
|
|
|
|
| |
OptionMetadataTags.
These are similar, no need to have both fields. Removing the "DOCUMENTED" default, the absence of UNDOCUMENTED will be used instead.
Since requiring a documentation category for undocumented options doesn't make sense, list that as one of the OptionDocumentationCategories, but list HIDDEN and INTERNAL as part of OptionMetadata. These options should list UNDOCUMENTED as their category.
PiperOrigin-RevId: 161515674
|
|
|
|
|
|
|
|
|
|
| |
Simplify the code by providing the default implementation of
`SkylarkValue$isImmutable` that always returns false. All objects are
considered mutable unless their `isImmutable` method is overridden.
This change doesn't affect the current behavior.
PiperOrigin-RevId: 161422029
|
|
|
|
|
|
|
| |
Error message is simpler and doesn't show the type of all arguments.
RELNOTES: None.
PiperOrigin-RevId: 161187134
|
|
|
|
|
|
|
|
| |
If --incompatible_descriptive_string_representations is passed, select values
are converted to strings using `str`, `repr` and `print` functions differently:
"select(...)" instead of "selector(...)".
PiperOrigin-RevId: 161129809
|
|
|
|
|
|
|
|
|
| |
If --incompatible_descriptive_string_representations is passed, functions and rule
classes are converted to strings using `str`, `repr` and `print` functions
differently (more descriptive, without leaking information that shouldn't
be accessible).
PiperOrigin-RevId: 161087777
|
|
|
|
|
|
|
| |
Also, replace noTypeDefined with typeDefined.
RELNOTES: None.
PiperOrigin-RevId: 161079981
|
|
|
|
|
|
|
|
| |
This is an incompatible change, but it's an obvious bug.
RELNOTES[INC]: Fixed a bug whereby multiple load() statements could appear on the same line
PiperOrigin-RevId: 161070399
|
|
|
|
| |
PiperOrigin-RevId: 161034828
|
|
|
|
|
|
|
|
|
|
|
|
| |
In other words, we now forbid these:
[] = []
() = ()
_, [] = f()
RELNOTES[INC]:
lvalues must have define at least one variable (i.e. we forbid `[] = f()`).
PiperOrigin-RevId: 160981283
|
|
|
|
|
|
|
|
|
|
|
| |
If --incompatible_descriptive_string_representations is passed, labels are converted
to strings using `repr` differently: `Label("//package:name")` instead of
`"//package:name"`
This CL doesn't affect representations of other object types but provides the
necessary infrastructure for it.
PiperOrigin-RevId: 160955284
|
|
|
|
|
|
|
| |
RELNOTES[INC]:
`load` is now a language keyword, it cannot be used as an identifier
PiperOrigin-RevId: 160944121
|
|
|
|
|
|
| |
RELNOTES[INC]: Using tabulation for identation is now fobidden in .bzl files
PiperOrigin-RevId: 160888064
|
|
|
|
|
|
|
| |
RELNOTES:
Evaluation will soon use checked arithmetics and throw an error instead of
overflow/underflow.
PiperOrigin-RevId: 160834366
|
|
|
|
|
| |
RELNOTES: None.
PiperOrigin-RevId: 160831413
|
|
|
|
|
| |
RELNOTES: None.
PiperOrigin-RevId: 160817326
|
|
|
|
|
|
|
| |
It's now easier to customize Printer if in different situations objects should
be printed differently. Also its API is cleaner now. Names of methods of SkylarkValue objects now reflect names of Skylark functions: SkylarkValue#repr and SkylarkPrintableValue#str.
PiperOrigin-RevId: 160635154
|
|
|
|
|
|
|
| |
With a few manual fixes for readability.
RELNOTES: None.
PiperOrigin-RevId: 160582556
|
|
|
|
|
| |
RELNOTES: None.
PiperOrigin-RevId: 160516183
|
|
|
|
|
|
| |
Leave the category for now as the generated docs still do not use the new categorization.
PiperOrigin-RevId: 160290297
|
|
|
|
|
|
|
| |
This can be used to canonically compare ASTs for equality, e.g. in tests.
RELNOTES: None
PiperOrigin-RevId: 160283160
|