aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/syntax/EvalUtils.java
Commit message (Collapse)AuthorAge
* Define a reusable comparator for Skylark objects.Gravatar Laurent Le Brun2015-04-16
| | | | | -- MOS_MIGRATED_REVID=91304912
* 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
* Provide cleaner syntax error messages using select.Gravatar Greg Estren2015-04-10
| | | | | | | | | | | | | | Given: genrule(srcs = ['somefile'] + select({...})) Before this change: ERROR: unsupported operand type(s) for +: 'List' and 'SelectorValue' After this change: ERROR: unsupported operand type(s) for +: 'List' and 'select' -- MOS_MIGRATED_REVID=90750232
* Enable support for multiple variable assignments.Gravatar Laurent Le Brun2015-03-23
| | | | | | | | | | This happens in for loops, list comprehensions and simple assigment. e.g. a, b = expr [a for a, b in expr] -- MOS_MIGRATED_REVID=89123977
* Skylark: Define dict iteration order (sorted by key).Gravatar Laurent Le Brun2015-03-18
| | | | | -- MOS_MIGRATED_REVID=88924033
* Print singleton tuples with a commaGravatar Francois-Rene Rideau2015-03-18
| | | | | | | | | | Like python, print singleton tuples with a terminating comma before the closing parenthesis, so you can read them back as tuples. Also, have toString() call the pretty-printer for Skylark lists and tuples. -- MOS_MIGRATED_REVID=88831764
* Misc Skylark cleanups and small featuresGravatar Francois-Rene Rideau2015-03-10
| | | | | -- MOS_MIGRATED_REVID=88224368
* Skylark: Show ordering when pretty-printing sets.Gravatar Laurent Le Brun2015-03-10
| | | | | -- MOS_MIGRATED_REVID=88149329
* Restore Skylark "support" for inheritanceGravatar Francois-Rene Rideau2015-03-06
| | | | | | | | | | Classes of the same EvalUtils.getSkylarkType are once again the same for the type inferencer. Also, for debugging purposes, only print SkylarkClassObject as struct, not all classes that implement ClassObject yet are considered disjoint by the type engine. -- MOS_MIGRATED_REVID=87933890
* Some cleanup changes.Gravatar Ulf Adams2015-03-05
| | | | | -- MOS_MIGRATED_REVID=87821306
* Fix race condition in SkylarkType.ofGravatar Francois-Rene Rideau2015-03-05
| | | | | | | | | | | Fix race condition in SkylarkType.of(), whereby .equals() but not same (==) types were created, by making Simple.of() synchronized. Also make SkylarkType#includes() more robust by using .equals() instead of == (it's a little bit slower in the case of Simple types once fixed, but also works on complex types that don't hash-cons their values). Also, distinguish SkylarkList (printed as list) and java.util.List (printed as List) and similarly for tuple vs Tuple, when printing types in debugging messages. -- MOS_MIGRATED_REVID=87490176
* 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 linter issues in lib/syntax.Gravatar Laurent Le Brun2015-02-09
| | | | | -- MOS_MIGRATED_REVID=85882605
* Update from Google.Gravatar Han-Wen Nienhuys2015-02-25
-- MOE_MIGRATED_REVID=85702957