aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/syntax/BinaryOperatorExpression.java
Commit message (Collapse)AuthorAge
* Rollback of commit f941d56acfad5f8c819c81b494f806ea74ea7fd8.Gravatar Carmi Grushko2016-02-02
| | | | | | | | | | | | | | | | | | *** Reason for rollback *** Breaks many targets, see [] *** Original change description *** Reinstate mutable SkylarkDict Add <String, Object> annotation to optionMap invocation in SkylarkAttr, to make JDK 1.7 happy. Give the visible name "aspect" to class SkylarkAspect. -- MOS_MIGRATED_REVID=113543873
* Reinstate mutable SkylarkDictGravatar Francois-Rene Rideau2016-02-01
| | | | | | | | | | Add <String, Object> annotation to optionMap invocation in SkylarkAttr, to make JDK 1.7 happy. Give the visible name "aspect" to class SkylarkAspect. -- MOS_MIGRATED_REVID=113394826
* Rollback of commit c0a8c58b9230a1f5d76269eb7dc6b11e18f19686.Gravatar Damien Martin-Guillerez2016-01-29
| | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Break Java 1.7 builds of Bazel. See http://ci.bazel.io/job/Bazel/JAVA_VERSION=1.7,PLATFORM_NAME=linux-x86_64/327/console Test: git clone ... && git revert c0a8c58 && export JAVA_VERSION=1.7 && export BAZEL_COMPILE_TARGET=compile && bash -c "source scripts/ci/build.sh; bazel_build" *** Original change description *** Make Skylark dicts mutable Represent Skylark dict using a new subclass SkylarkDict<K, V> of Map<K, V>. Back it with a TreeMap to provide a deterministic iteration order. Also make SkylarkList generic in its element type <E>. Have Artifact implement Comparable<Object> so it can be used as TreeMap key. -- MOS_MIGRATED_REVID=113359718
* Make Skylark dicts mutableGravatar Francois-Rene Rideau2016-01-29
| | | | | | | | | | Represent Skylark dict using a new subclass SkylarkDict<K, V> of Map<K, V>. Back it with a TreeMap to provide a deterministic iteration order. Also make SkylarkList generic in its element type <E>. Have Artifact implement Comparable<Object> so it can be used as TreeMap key. -- MOS_MIGRATED_REVID=113277489
* Make SkylarkList a List.Gravatar Francois-Rene Rideau2016-01-22
| | | | | | | | | | | | | | | SkylarkList now implements the List interfaces, except that its mutating methods throw an UnsupportedOperationException, just like ImmutableList does. To actually mutate a SkylarkList, you need to pass a Location and a suitable Environment object with a matching Mutability while it is still active. Introduce SkylarkMutable and SkylarkMutable.MutableCollection to better handle mutable data structures. Remove some functions in EvalUtils made obsolete by this and previous changes regarding Skylark lists. -- MOS_MIGRATED_REVID=112768457
* Compile function call expressions.Gravatar Florian Weikert2015-11-10
| | | | | | | Mostly reuses the interpreters argument checking and helper functions. -- MOS_MIGRATED_REVID=107395974
* Compile binary operations to byte code.Gravatar Florian Weikert2015-11-10
| | | | | -- MOS_MIGRATED_REVID=107391382
* Unify Skylark and BUILD listsGravatar Francois-Rene Rideau2015-10-20
| | | | | | | | Use SkylarkList everywhere rather than either List or GlobList. Keep a GlobList underneath a MutableList, where applicable. -- MOS_MIGRATED_REVID=105864035
* Rationalize copyright headersGravatar Damien Martin-Guillerez2015-09-25
| | | | | | | | | | | The headers were modified with `find . -type f -exec 'sed' '-Ei' 's|Copyright 201([45]) Google|Copyright 201\1 The Bazel Authors|' '{}' ';'` And manual edit for not Google owned copyright. Because of the nature of ijar, I did not modified the header of file owned by Alan Donovan. The list of authors were extracted from the git log. It is missing older Google contributors that can be added on-demand. -- MOS_MIGRATED_REVID=103938715
* Separate build-specific types and types inherent to Skylark.Gravatar Lukacs Berki2015-09-21
| | | | | -- MOS_MIGRATED_REVID=103374106
* Refactor SkylarkList to allow MutableListGravatar Francois-Rene Rideau2015-09-21
| | | | | | | | Make SkylarkList no longer read-only to match Python and the BUILD language. Instead, subject it to a Mutability object inherited from the Environment. -- MOS_MIGRATED_REVID=103332973
* Cleanup Skylark types some moreGravatar Francois-Rene Rideau2015-09-17
| | | | | | | | | | | Clarify the criterion for being a valid Skylark value; stop claiming immutability is "the" criterion when Skylark now has mutable values; stop relying on a reflection with a magic list (this also fixes the SkylarkShell build). Clarify the criterion for determining immutable types when making a SkylarkNestedSet. Clarify and use the criterion for being a valid Skylark dict key. -- MOS_MIGRATED_REVID=103313934
* Fixed Skylark stack trace:Gravatar Florian Weikert2015-09-11
| | | | | | | | | - Moved registration mechanism from BaseFunction into ASTNode / Statement / Expression - Added more details about statements/expressions to the output trace (including if's) - Fixed wrong locations -- MOS_MIGRATED_REVID=102841164
* Refactor skylark format internalsGravatar Francois-Rene Rideau2015-08-26
| | | | | | | | | | Rename some methods to avoid clashes. Add function formattable to create lazily-formatted objects, remove now unused strFormattable and reprFormattable. Also some whitespace cleanup. -- MOS_MIGRATED_REVID=101459565
* Introduce '|' operator for set union.Gravatar Laurent Le Brun2015-08-25
| | | | | -- MOS_MIGRATED_REVID=101363350
* Skylark: support %r format specifierGravatar Francois-Rene Rideau2015-06-17
| | | | | | | | Refactor the implementation of format. Add %r. Improve some error messages. -- MOS_MIGRATED_REVID=96154542
* Implement Skylark function reprGravatar Francois-Rene Rideau2015-06-15
| | | | | | | | | | | | | | | | | Move printing code from EvalUtils to Printer. Rename functions in Printer: printValue becomes str or print, prettyPrintValue becomes repr or write, formatString becomes format, makeFormattable becomes strFormattable, prettyPrintValues becomes listString. write being self-sufficient is made the reference, and print is the one that is a wrapper around write, rather than the other way around, avoiding mutual recursion. -- MOS_MIGRATED_REVID=95897834
* Inline Maps.newLinkedHashMap()Gravatar Damien Martin-Guillerez2015-05-15
| | | | | | | | | This function was introduced in Guava 0.19 but Guava 0.19 is not yet released. We know exactly the size we want for the map so there is no need to request extraneous space. -- MOS_MIGRATED_REVID=93702023
* Use a LinkedHashMap do the addition of dictionnariesGravatar Damien Martin-Guillerez2015-05-15
| | | | | | | | | | Previously, the resulting map was using a HashMap as an intermediate map to construct the final map then converted to an ImmutableMap. HashMap iteration or is non-deterministic and can even vary between execution of the same binary. -- MOS_MIGRATED_REVID=93512467
* Allow SkylarkList (list) to be cat'd to native java ListGravatar Damien Martin-Guillerez2015-05-15
| | | | | | | | | | | | | | | If a SkylarkList is an operand of the + operator, the other parameter is converted to a SkylarkList so we can actually perform the concatenation. A few exceptions are needed to maintain the legacy behavior. This change also extract the + operator part in a separate function. Fixes #121 -- MOS_MIGRATED_REVID=93503382
* Build language: Support 'not in' operator.Gravatar Laurent Le Brun2015-05-08
| | | | | -- MOS_MIGRATED_REVID=93129861
* Define a reusable comparator for Skylark objects.Gravatar Laurent Le Brun2015-04-16
| | | | | -- MOS_MIGRATED_REVID=91304912
* Build language supports list comparison.Gravatar Laurent Le Brun2015-04-16
| | | | | -- MOS_MIGRATED_REVID=91289047
* Build language: Implement integer divisionGravatar Laurent Le Brun2015-04-15
| | | | | -- MOS_MIGRATED_REVID=91192716
* Catch modulo by 0 errorsGravatar Laurent Le Brun2015-04-15
| | | | | -- MOS_MIGRATED_REVID=91181886
* Skylark: Remove static type checksGravatar Laurent Le Brun2015-04-15
| | | | | -- MOS_MIGRATED_REVID=91175430
* Configurable attributes: support embeddable selects. With thisGravatar Greg Estren2015-04-14
| | | | | | | | | | | | | | | | change, the following syntax: deps = [':always'] + select({':a': [':adep'], ':b': [':bdep']}) or deps = select({':a': [':adep'], ':b': [':bdep']}) + select({':c': [':cdep'], ':d': [':ddep']}) works. -- MOS_MIGRATED_REVID=91016337
* Simplify Skylark testsGravatar Francois-Rene Rideau2015-04-13
| | | | | | | | | | | | | | | | | | Use the new EvaluationContext infrastructure to simplify Skylark tests (said infrastructure is originally based on code from these tests). Merge AbstractEvaluationTestCase and AbstractParserTestCase into a non-abstract class EvaluationTestCase that uses EvaluationContext. Cleanup the EventCollectionApparatus it uses. Refactor all Skylark tests to use this new infrastructure. Fix EvaluationTest and MethodLibraryTest to actually and correctly run tests in both modes. Fix small bugs in the main code base discovered by actually running the code in both modes, and make error messages identical when possible. -- MOS_MIGRATED_REVID=90828053
* Skylark: 'in' works on sets.Gravatar Laurent Le Brun2015-03-31
| | | | | -- MOS_MIGRATED_REVID=89977206
* Lift differences between Skylark and BUILD evaluation, wrt to concatenation.Gravatar Laurent Le Brun2015-03-18
| | | | | | | In particular, struct, dict and set addition work like in Skylark files. -- MOS_MIGRATED_REVID=88929558
* Skylark: Static checks allows None value everywhere.Gravatar Laurent Le Brun2015-03-16
| | | | | -- MOS_MIGRATED_REVID=88713932
* Skylark: DictionaryLiteral is immutable (like every dict).Gravatar Laurent Le Brun2015-03-13
| | | | | -- MOS_MIGRATED_REVID=88440711
* Add Union, contains() to SkylarkTypeGravatar Francois-Rene Rideau2015-03-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor SkylarkType, notably adding Union types and runtime typechecks. These are pre-requisites to unifying all Skylark function calls to use the same code path, that will check types (like SkylarkFunction currently does) as well handle a more complete Python calling convention (like MixedModeFunction is almost but not quite able to do). A SkylarkType can be either * a Simple type corresponding to a Java class, with special types TOP and BOTTOM corresponding respectively to Object and EmptyType (similar to Void). * a Combination of a generic class (LIST, MAP or SET) and an argument type * a Union of a finite number of types * a FunctionType associated with a name and a returnType (with ugly validation-time side-effects that we should probably move out of the type) Unions are necessary because: 1- the type of some builtin function arguments are actually the Union of some type and a function type for a callback that computes the actual value. 2- the type of some builtin function arguments declared as "List" is actually the Union of java List and SkylarkList. 3- instead of adding lots of special cases at the point of argument validation, it's cleaner and more generally useful to have explicit Union types, that can then be displayed to users for documentation or debugging purposes. Validation-time "type inference" is re-expressed simply as type intersection. None is treated specially as inferred into TOP instead of NoneType. Combination types are printed as genericType of argTypes, e.g. "dict of ints". "type" and "generic1" become "genericType" and "argType". In SkylarkList and SkylarkNestedSet, genericType becomes contentType. -- MOS_MIGRATED_REVID=87340881
* Tweaks off of upcoming changes to SkylarkType.Gravatar Francois-Rene Rideau2015-02-25
| | | | | -- MOS_MIGRATED_REVID=87154772
* Cosmetic changes moved out of []Gravatar Francois-Rene Rideau2015-02-11
| | | | | | | | These shouldn't affect the semantic of the program in any significant way, but will hush the linter and other such metaprograms. -- MOS_MIGRATED_REVID=86089271
* Fix or suppress warnings in Blaze code. #fixitGravatar Laszlo Csomor2015-02-06
| | | | | -- MOS_MIGRATED_REVID=85722639
* Update from Google.Gravatar Han-Wen Nienhuys2015-02-25
-- MOE_MIGRATED_REVID=85702957