aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/syntax
Commit message (Collapse)AuthorAge
...
* Use Iterators.unmodifiableIterator() for readabilityGravatar brandjon2017-08-08
| | | | | RELNOTES: None PiperOrigin-RevId: 164457611
* Add tuple * int multiplication operatorGravatar brandjon2017-08-07
| | | | | | | I.e., ('a', 'b') * 3 == ('a', 'b', 'a', 'b', 'a', 'b'), like lists. RELNOTES: None PiperOrigin-RevId: 164403099
* Fix mutability bug in SkylarkList/SkylarkMap Java APIsGravatar brandjon2017-08-07
| | | | | | | | | 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
* Make selector list construction n^2 -> n efficient.Gravatar gregce2017-08-07
| | | | | | | | | | | | | | | 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
* Bypass unnecessary ArrayLists in SkylarkNestedSet constructorGravatar michajlo2017-08-07
| | | | | | | 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
* Minor optimization to function arg parsingGravatar michajlo2017-08-07
| | | | | | | 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
* Cleanup SkylarkListGravatar brandjon2017-08-04
| | | | | | | | | | | | | | | - 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
* Make MutableList#EMPTY privateGravatar brandjon2017-08-04
| | | | | RELNOTES: None PiperOrigin-RevId: 164131012
* Documentation fix for 'str' and 'repr' functions.Gravatar laurentlb2017-08-03
| | | | | RELNOTES: None. PiperOrigin-RevId: 164102319
* Cleanup javadoc around Mutability / SkylarkMutableGravatar brandjon2017-08-03
| | | | | | | | | 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
* Make list EMPTY instance work like tuplesGravatar brandjon2017-08-02
| | | | | | | I.e., use an accessor for type inference. The EMPTY field will be made private in a future CL. RELNOTES: None PiperOrigin-RevId: 163843569
* Refactor augmented assignment and lvaluesGravatar brandjon2017-07-26
| | | | | | | Also fix minor bug where a[b] += c would evaluate b twice. RELNOTES: None PiperOrigin-RevId: 163103618
* Add --internal_do_not_export_builtins, for testingGravatar brandjon2017-07-25
| | | | | | | | | 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
* Improve documentation in MethodLibrary, add examples for builtins.Gravatar laurentlb2017-07-21
| | | | | RELNOTES: None. PiperOrigin-RevId: 162623144
* Skylark documentation: Replace "set" and "List" plain-text return types with ↵Gravatar fwe2017-07-21
| | | | | | links to "deptset" and "list". PiperOrigin-RevId: 162607082
* Use double-quotes instead of single-quotes for consistency.Gravatar laurentlb2017-07-20
| | | | | RELNOTES: None. PiperOrigin-RevId: 162518452
* Update documentation of `dict`, mention it's mutable.Gravatar laurentlb2017-07-20
| | | | | RELNOTES: None. PiperOrigin-RevId: 162505701
* Mark PACKAGE_NAME and REPOSITORY_NAME as deprecated.Gravatar laurentlb2017-07-19
| | | | | RELNOTES: None. PiperOrigin-RevId: 162475651
* Clean up a few Skylark-Skyframe structuresGravatar brandjon2017-07-19
| | | | | | | Add value-class methods to SkylarkFileDependency and SkylarkImportLookupValue. Remove Java serialization hack from Extension. RELNOTES: None PiperOrigin-RevId: 162383283
* Make the @Option annotation depend on the java version of the tagging enums.Gravatar ccalvarin2017-07-18
| | | | | | | 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
* Doc typoGravatar brandjon2017-07-17
| | | | | RELNOTES: None PiperOrigin-RevId: 162135034
* Clean up string representations for unknown objectsGravatar vladmos2017-07-17
| | | | | | | | 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
* Fix crash when unioning depsets with different ordersGravatar brandjon2017-07-14
| | | | | | | 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
* New flag --incompatible_string_is_not_iterable to forbid iteration over strings.Gravatar laurentlb2017-07-13
| | | | | RELNOTES: None. PiperOrigin-RevId: 161706309
* Automated rollback of commit 0d2aa6369b09940d584b544fb10796387e0fafa0.Gravatar brandjon2017-07-12
| | | | | | *** Reason for rollback *** PiperOrigin-RevId: 161567104
* Misc cleanups of syntax dirGravatar brandjon2017-07-12
| | | | | RELNOTES: None PiperOrigin-RevId: 161560683
* Misc cleanups of AST node APIGravatar brandjon2017-07-12
| | | | | | | | | - 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
* Clean up string representations for unknown objectsGravatar vladmos2017-07-12
| | | | | | | | 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
* Add register_toolchains function to the WORKSPACE for registering toolchains ↵Gravatar John Cater2017-07-11
| | | | | | | | | to use. Part of #2219. Change-Id: Id6dfe6ec102f609bb19461242a098bf977be29ae PiperOrigin-RevId: 161527986
* Make some objects SkylarkValuesGravatar vladmos2017-07-11
| | | | | | | | | 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
* Fold OptionUsageRestrictions into OptionDocumentationCategory and ↵Gravatar ccalvarin2017-07-11
| | | | | | | | | | 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
* Make SkylarkValue instances mutable by defaultGravatar vladmos2017-07-11
| | | | | | | | | | 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
* Improve error message when calling a builtin function with wrong typeGravatar laurentlb2017-07-07
| | | | | | | Error message is simpler and doesn't show the type of all arguments. RELNOTES: None. PiperOrigin-RevId: 161187134
* Clean up string representations for select valuesGravatar vladmos2017-07-07
| | | | | | | | 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
* Clean up string representations for functionsGravatar vladmos2017-07-07
| | | | | | | | | 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
* Remove showName argument in FunctionSignature, it was always true.Gravatar laurentlb2017-07-07
| | | | | | | Also, replace noTypeDefined with typeDefined. RELNOTES: None. PiperOrigin-RevId: 161079981
* Prohibit multiple load() statements from appearing on the same lineGravatar brandjon2017-07-07
| | | | | | | | 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
* Fix SkylarkDict.castSkylarkDictOrNoneToDict to return a Map.Gravatar jcater2017-07-06
| | | | PiperOrigin-RevId: 161034828
* Require LValues to have at least one variable.Gravatar laurentlb2017-07-06
| | | | | | | | | | | | 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
* Clean up string representations for labelsGravatar vladmos2017-07-05
| | | | | | | | | | | 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
* Make 'load' a keywordGravatar laurentlb2017-07-05
| | | | | | | RELNOTES[INC]: `load` is now a language keyword, it cannot be used as an identifier PiperOrigin-RevId: 160944121
* Forbid tabs for indentationGravatar laurentlb2017-07-05
| | | | | | RELNOTES[INC]: Using tabulation for identation is now fobidden in .bzl files PiperOrigin-RevId: 160888064
* New flag `--incompatible_checked_arithmetic` to use checked arithmetics.Gravatar laurentlb2017-07-05
| | | | | | | RELNOTES: Evaluation will soon use checked arithmetics and throw an error instead of overflow/underflow. PiperOrigin-RevId: 160834366
* Introduce --incompatible_new_actions_api flag.Gravatar dslomov2017-07-05
| | | | | RELNOTES: None. PiperOrigin-RevId: 160831413
* Migrate tests to ctx.actions.run/run_shell.Gravatar dslomov2017-07-05
| | | | | RELNOTES: None. PiperOrigin-RevId: 160817326
* Refactor PrinterGravatar vladmos2017-07-03
| | | | | | | 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
* Automated conversion to Java 8Gravatar laurentlb2017-06-30
| | | | | | | With a few manual fixes for readability. RELNOTES: None. PiperOrigin-RevId: 160582556
* Lambda cleanupGravatar laurentlb2017-06-29
| | | | | RELNOTES: None. PiperOrigin-RevId: 160516183
* Update the --incompatible_ flag requirements to use the metadata tag.Gravatar ccalvarin2017-06-28
| | | | | | Leave the category for now as the generated docs still do not use the new categorization. PiperOrigin-RevId: 160290297
* Add a pretty printer for Skylark ASTsGravatar brandjon2017-06-28
| | | | | | | This can be used to canonically compare ASTs for equality, e.g. in tests. RELNOTES: None PiperOrigin-RevId: 160283160