aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/syntax
Commit message (Collapse)AuthorAge
* Rollback of commit 0d1dc5537903a8c2ad56e66cee129b8f4d4e2592.Gravatar Pedro Liberal Fernandez2017-01-11
| | | | | | -- PiperOrigin-RevId: 144194956 MOS_MIGRATED_REVID=144194956
* Improve performance and semantics of union of Skylark setsGravatar Jon Brandvein2017-01-10
| | | | | | | | | | | | | | | | | | | | | | == Before this change == Previously, if a and b are sets, then a + b created a new set c whose direct and transitive elements were all those of a, and with b appended as an additional transitive element. If on the other hand b is a list instead of a set, then its contents were appended as additional direct elements of c. In both cases, you can think of c as a copy of a that also knows about b. This copying of a's elements into c can lead to accumulation when you do it repeatedly, e.g. x += y in a loop. Each union can take O(n) time so you get O(n^2) time overall. Nested set union is supposed to be O(1) time per operation and O(n) time overall. It also leads to surprising iteration orders. If you do a + b + c + d (left-associative), where each one is a set, then when you do a post-order traversal you get the elements of b, c, d, and a, in that order. This is because b, c, and d each get appended as transitive children of the copies of a. == After this change == If a and b are sets, then a + b returns a new set c with a and b as its two transitive children. If b is a list, then c has a as its only transitive child and b's elements as its only direct elements. This is straightforward, O(1), and avoids the problem with the confusing order. It is implemented by removing the items/transitiveItems fields and just relying on NestedSetBuilder. RELNOTES[INC]: (Skylark) Set union is now O(1). As a side-effect, the iteration order of sets produced by union has changed. "print(set([1]) + set([2]) + set([3]))" will now give back the order 1, 2, 3 instead of 2, 3, 1. -- PiperOrigin-RevId: 143972165 MOS_MIGRATED_REVID=143972165
* Minor improvements to error messages.Gravatar Laurent Le Brun2017-01-04
| | | | | | | | In case of conflict, show the location of the original rule. -- PiperOrigin-RevId: 143541281 MOS_MIGRATED_REVID=143541281
* Manually add periods to documentation strings where needed.Gravatar John Cater2017-01-03
| | | | | | | | -- Change-Id: I9ec3209a69ba5a51943b334f278ba93d67d4f9f4 Reviewed-on: https://cr.bazel.build/8090 PiperOrigin-RevId: 143470915 MOS_MIGRATED_REVID=143470915
* Make the string strip() methods compatible with PythonGravatar Jon Brandvein2017-01-03
| | | | | | | | | | | | | | strip(), lstrip(), and rstrip() now accept a None argument as a synonym for the no-arg version. The characters that are considered as whitespace (to be removed by default in the no-arg form) are now the same as in Python 3.6. RELNOTES[INC]: The string methods strip(), lstrip(), and rstrip() now by default remove the same whitespace characters as Python 3 does, and accept None as an argument. -- PiperOrigin-RevId: 143388250 MOS_MIGRATED_REVID=143388250
* Add 'did you mean' suggestion for load() statements.Gravatar Laurent Le Brun2017-01-03
| | | | | | -- PiperOrigin-RevId: 143381556 MOS_MIGRATED_REVID=143381556
* Add 'did you mean' suggestion when accessing a struct fieldGravatar Laurent Le Brun2017-01-03
| | | | | | -- PiperOrigin-RevId: 143380643 MOS_MIGRATED_REVID=143380643
* Add 'did you mean' suggestion when accessing an undefined variable.Gravatar Laurent Le Brun2017-01-03
| | | | | | -- PiperOrigin-RevId: 143373605 MOS_MIGRATED_REVID=143373605
* Cleanup in error messages, try to improve consistency.Gravatar Laurent Le Brun2017-01-03
| | | | | | -- PiperOrigin-RevId: 143204724 MOS_MIGRATED_REVID=143204724
* Make depsets temporarily completely backward compatibleGravatar Vladimir Moskva2016-12-27
| | | | | | | | | `str(depset(...))` should return "set(...)" for now as some of the existing code may rely on it. -- PiperOrigin-RevId: 143014369 MOS_MIGRATED_REVID=143014369
* Add `depset` as an alias to `set` in SkylarkGravatar Vladimir Moskva2016-12-27
| | | | | | | | | | Renamed all occurrences of `set` to `depset`, added a `set` object constructor for (temporary) backward compatibility. `type(depset())` still temporarily returns "set", that will be changed in the future. RELNOTES: The `set` constructor is deprecated in favor of `depset` -- PiperOrigin-RevId: 142851587 MOS_MIGRATED_REVID=142851587
* Add a new AST node for augmented assignments in SkylarkGravatar Vladimir Moskva2016-12-19
| | | | | | -- PiperOrigin-RevId: 142438943 MOS_MIGRATED_REVID=142438943
* New operators for Skylark:Gravatar Andreas Bergmeier2016-12-15
| | | | | | | | | | | | | - list * int - int * list RELNOTES[NEW]: Skylark: you can now multiply a list by an integer to get the concatenation of N copies of this list, e.g. [a,b] * 3 = [a,b,a,b,a,b] -- Change-Id: I2068ad30e11df26dc7b4b8c41e51f85db56f0390 Reviewed-on: https://github.com/bazelbuild/bazel/pull/1524 PiperOrigin-RevId: 142140726 MOS_MIGRATED_REVID=142140726
* Add tuple() method to Skylark.Gravatar Googler2016-12-12
| | | | | | | | This method coerces any collection to a Skylark tuple, analogous to list() or set(). -- PiperOrigin-RevId: 141779268 MOS_MIGRATED_REVID=141779268
* Allow dicts to contain non-comparable objects as keysGravatar Vladimir Moskva2016-12-05
| | | | | | | | | RELNOTES: Skylark dicts internally don't rely on keys order anymore and accept any hashable values (i.e. structs with immutable values) as keys. Iteration order of dictionaries is no longer specified. -- PiperOrigin-RevId: 141055080 MOS_MIGRATED_REVID=141055080
* Rollback of commit 7c4a8093da6272969c86f22a08c72ddbbf6e8274.Gravatar Kristina Chodorow2016-12-02
| | | | | | | | | | | | | | | | | *** Reason for rollback *** Broke //src/test/shell/bazel:external_skylark_load_test See http://ci.bazel.io/job/bazel-tests/BAZEL_VERSION=HEAD,PLATFORM_NAME=linux-x86_64/370/console, for example. *** Original change description *** Remove callerLabel from Environment. It is a Bazel-specific information. -- MOS_MIGRATED_REVID=140742037
* Remove callerLabel from Environment.Gravatar Laurent Le Brun2016-12-01
| | | | | | | It is a Bazel-specific information. -- MOS_MIGRATED_REVID=140719791
* Rollback of commit c182908910a370b490e7e027b867e11f9f2fb086.Gravatar Michajlo Matijkiw2016-12-01
| | | | | | | *** Reason for rollback *** -- MOS_MIGRATED_REVID=140687884
* Allow dicts to contain non-comparable objects as keysGravatar Vladimir Moskva2016-11-30
| | | | | | | | RELNOTES: Skylark dicts internally don't rely on keys order anymore and accept any hashable values (i.e. structs with immutable values) as keys. Iteration order of dictionaries is no longer specified. -- MOS_MIGRATED_REVID=140591710
* Remove isSkylark and eval from Environment.Gravatar Laurent Le Brun2016-11-29
| | | | | -- MOS_MIGRATED_REVID=140371603
* SkylarkCallbackFunction no longer cares about the obsolete 'cfg' parameter.Gravatar Florian Weikert2016-11-29
| | | | | | | | | Depot cleanup is in unknown commit. RELNOTES[INC]: Callback functions in Skylark no longer support the cfg parameter. This is a cleanup and only affects the signatures of callbacks, since the parameter hasn't been set since September 2016. -- MOS_MIGRATED_REVID=140356006
* Rollback of commit 984d6d48d0e07ac3be2bbfec667158165390eb4f.Gravatar Tobias Werth2016-11-24
| | | | | -- MOS_MIGRATED_REVID=140121290
* Introduce BlazeInterners, a Blaze-specific wrapper around Guava's Interners ↵Gravatar Nathan Harmata2016-11-24
| | | | | | | | | | | that makes an appropriate call to Interners.InternerBuilder#concurrencyLevel. For current readers of this CL, I used this class everywhere in the Blaze codebase. For future readers of this CL, this class should be used to create an Interner in the Blaze codebase. -- MOS_MIGRATED_REVID=140063271
* Remove useless function in BuildFileAST.Gravatar Laurent Le Brun2016-11-23
| | | | | -- MOS_MIGRATED_REVID=140040343
* Remove Environment.parseFileGravatar Laurent Le Brun2016-11-23
| | | | | -- MOS_MIGRATED_REVID=140037282
* Remove weird restriction on '|' operator from SkylarkNestedSets.Gravatar Dmitry Lomov2016-11-23
| | | | | -- MOS_MIGRATED_REVID=139926067
* Allow dicts to contain non-comparable objects as keysGravatar Vladimir Moskva2016-11-22
| | | | | | | | RELNOTES: Skylark dicts internally don't rely on keys order anymore and accept any hashable values (i.e. structs with immutable values) as keys. -- MOS_MIGRATED_REVID=139914704
* Minor refactoring in SkylarkUtilsGravatar Laurent Le Brun2016-11-22
| | | | | | | Next step will be to move Environment.Phase to SkylarkUtils.BazelInfo -- MOS_MIGRATED_REVID=139902745
* Move Bazel-specific functions in a separate file.Gravatar Laurent Le Brun2016-11-21
| | | | | | | | "type", "set" and "select" should not be part of the standalone Skylark library. -- MOS_MIGRATED_REVID=139578095
* Allow labels in the '--aspects' parameter.Gravatar Dmitry Lomov2016-11-21
| | | | | -- MOS_MIGRATED_REVID=139573590
* Adding an option to set the digest function that everything uses. Minor ↵Gravatar Ola Rozenfeld2016-11-18
| | | | | | | | | | | | | refactoring: enabling potential fast digest computation of more than one digest function type. Usage: bazel --host_jvm_args="-Dbazel.DigestFunction=SHA1" build ... Ugliness: using a system property (a static non-final variable), because the better way to do it (a flag) would result in a much, much larger refactoring. More ugliness: I have updated the minimal amount of tests. A lot of tests are still relying on the default value of MD5. Ideally, they need to be updated as well. -- MOS_MIGRATED_REVID=139490836
* Fix bugs in slicing with a negative strideGravatar Jon Brandvein2016-11-14
| | | | | | | | | | | | | | There was a crash when the starting point of a negative slice is larger than the list length. In addition, there was an incorrect result when the ending point of a negative slice is less than the list's length times -1. It would wrongly exclude the first element. RELNOTES: Fix slicing bug where "abc"[:-4:-1] would give wrong answer -- MOS_MIGRATED_REVID=138878716
* Fix a bunch of typosGravatar Jon Brandvein2016-11-10
| | | | | -- MOS_MIGRATED_REVID=138757881
* Change error message to reflect broader syntax for assignmentsGravatar Jon Brandvein2016-11-10
| | | | | -- MOS_MIGRATED_REVID=138700111
* Prohibited comparison of Skylark setsGravatar Vladimir Moskva2016-11-08
| | | | | | | RELNOTES: Comparing sets (`if set1 < set2:`) is not allowed anymore in Skylark because it didn't work correctly anyway. -- MOS_MIGRATED_REVID=138408411
* Fixed StringIndexOutOfBoundsException in the lexerGravatar Vladimir Moskva2016-11-08
| | | | | -- MOS_MIGRATED_REVID=138387292
* EvalException can now show a url for additional informationGravatar Laurent Le Brun2016-11-04
| | | | | | | Add doc for the "read only" error message. -- MOS_MIGRATED_REVID=138194709
* Multiplying strings with negative numbers no longer leads to an exception.Gravatar Florian Weikert2016-11-02
| | | | | | | This CL also contains a small refactoring that should make the introduction of list-int-mulitplication easier. -- MOS_MIGRATED_REVID=137938998
* Allow calling attributes of built-in objects.Gravatar Vladimir Moskva2016-10-31
| | | | | | | | | If `f` is an object with an attribute `x` which is callable, it's valid now to call `f.x()` directly (caused a "no function called x" error before because .x is a attribute, not a method). -- MOS_MIGRATED_REVID=137698425
* Change getattr() behavior so 3-arg form doesn't fail when field is a methodGravatar Jon Brandvein2016-10-27
| | | | | | | RELNOTES: getattr()'s 3-arg form no longer raises an error when the retrieved field is a built-in method. -- MOS_MIGRATED_REVID=137390666
* Move ToolsRepository out of EnvironmentGravatar Laurent Le Brun2016-10-27
| | | | | | | | | Other fields will follow (is_skylark, phase, callerLabel). The goal is to make Environment (and more generally Skylark) less dependent on Bazel. -- MOS_MIGRATED_REVID=137386248
* Improve error message when failing to convert parameter types in Skylark ↵Gravatar Carmi Grushko2016-10-27
| | | | | | | function calls. -- MOS_MIGRATED_REVID=137303042
* Cleanup: remove isSkylark in Environment ContinuationGravatar Laurent Le Brun2016-10-27
| | | | | -- MOS_MIGRATED_REVID=137272887
* Cleanup in Environment, remove unused lookup functionGravatar Laurent Le Brun2016-10-27
| | | | | -- MOS_MIGRATED_REVID=137266170
* Cleanup in the parserGravatar Laurent Le Brun2016-10-26
| | | | | | | | | | - Move break/continue check from ValidationEnvironment to the Parser - Remove some differences between BUILD / Skylark parsing mode - Fix location off-by-one error in the break/continue tokens - Remove duplicated error message ('for loops are not allowed on top-level') -- MOS_MIGRATED_REVID=137259929
* Cleanup, remove differences between Build and Skylark environments.Gravatar Laurent Le Brun2016-10-14
| | | | | | | | | | | | | The only visible difference for users is that a few more functions are available in BUILD files. That's fine, this difference was not even documented. RELNOTES: A few functions are added to BUILD files for consistency (hash, dir, hasattr, getattr) with .bzl files, although they are not very useful. -- MOS_MIGRATED_REVID=136151633
* Simplify imports in BuildFileASTGravatar Laurent Le Brun2016-10-14
| | | | | | | We don't actually need a map. -- MOS_MIGRATED_REVID=136040005
* Refactoring for LoadStatementGravatar Laurent Le Brun2016-10-13
| | | | | | | | | | Use StringLiteral instead of String+Location. This improves consistency. getRawImports() now returns StringLiterals, which makes possible to show location in error messages. -- MOS_MIGRATED_REVID=136019586
* Refactor getParentWithSkylarkModule() into SkylarkInterfaceUtilsGravatar Jon Brandvein2016-10-13
| | | | | -- MOS_MIGRATED_REVID=135956016
* [Roll-forward] Rollback of commit dd299dbc61be51112534a4698f7cf2deee43053b.Gravatar Jon Brandvein2016-10-12
| | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Fixed underlying broken CL that was depended on *** Original change description *** Automated [] rollback of commit e025939e71b179ae0f6bd09ef3af474f49b853a2. *** Reason for rollback *** Depends on commit 9c25afe750a937b2152c21a93effc8b9ba82c27b, which needs to be rolled back. *** Original change description *** Add API for individual actions This exposes action inputs, outputs, argv, content, and substitutions (if applicable). -- MOS_MIGRATED_REVID=135821603