aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/syntax/FuncallExpression.java
Commit message (Collapse)AuthorAge
* Reduce differences between Skylark and Build evaluationGravatar Laurent Le Brun2015-12-28
| | | | | | | Add some functions to Build, allow method calls. -- MOS_MIGRATED_REVID=110835163
* Move annotation classes used for referencing framework Java classes from ↵Gravatar John Field2015-12-16
| | | | | | | | | | | | | | Skylark into their own package. This allows, e.g., classes in the syntax package to access classes in the cmdline package without creating circular dependencies. While we're here: - Removed a couple of unused BUILD deps flagged in []. - Updated SkylarkRuleImplementationFunctionsTest to remove non-ASCII characters and clarify the intent of the test. -- MOS_MIGRATED_REVID=110360763
* Compile function call expressions.Gravatar Florian Weikert2015-11-10
| | | | | | | Mostly reuses the interpreters argument checking and helper functions. -- MOS_MIGRATED_REVID=107395974
* 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
* Optionally limits the length of the output of Printer.printList() (default = ↵Gravatar Florian Weikert2015-10-05
| | | | | | | no). -- MOS_MIGRATED_REVID=104655508
* Rollback of commit d7b64bd03100300b79cd33d04904ce9b0e6a5332.Gravatar Janak Ramakrishnan2015-10-05
| | | | | | | | | *** Reason for rollback *** Some rules write the toString representation of lists of files to disk and then read it back again. This breaks that. -- MOS_MIGRATED_REVID=104524336
* Limit the length of the output of Printer.printList().Gravatar Florian Weikert2015-09-30
| | | | | -- MOS_MIGRATED_REVID=104197461
* 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
* 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 Environment-sGravatar Francois-Rene Rideau2015-09-11
| | | | | | | | | | | | | | | | | | | | Make Environment-s freezable: Introduce a class Mutability as a revokable capability to mutate objects in an Environment. For now, only Environment-s carry this capability. Make sure that every Mutability is revoked in the same function that create... This reinstates a change that previously rolled-back because it broke the serializability of SkylarkLookupValue. Bad news: serializing it succeeds for the wrong reason, because a SkylarkEnvironment was stored as a result (now an Environment.Extension) that was Serializable but inherited its bindings from an Environment (now an Environment.BaseExtension) which wasn't Serializable. Apparently, Java doesn't try to serialize the bindings then (or at least doesn't error out when it fails), because these bindings map variable names to pretty arbitrary objects, and a lot of those we find in practice aren't Serializable. Thus the current code passes the same tests as the previous code, but obviously the serialization is just as ineffective as it used to be. -- MOS_MIGRATED_REVID=102776694
* Fix error message when accessing unsupported operator [].Gravatar Laurent Le Brun2015-09-11
| | | | | | | | Old message was e.g. "No matching method found for $index(int) in set" -- MOS_MIGRATED_REVID=102685114
* Rollback of commit 5a94e59f02833f9142bad9203acd72626b089535.Gravatar Janak Ramakrishnan2015-09-08
| | | | | | | | | *** Reason for rollback *** Breaks serialization of SkyValues. -- MOS_MIGRATED_REVID=102457225
* Refactor Skylark Environment-sGravatar Francois-Rene Rideau2015-09-08
| | | | | | | | | | | | | | | | | Make Environment-s freezable: Introduce a class Mutability as a revokable capability to mutate objects in an Environment. For now, only Environment-s carry this capability. Make sure that every Mutability is revoked in the same function that creates it, so no Environment is left open for modification after being created and exported; exceptions for tests, the shell and initialization contexts. Unify Environment, SkylarkEnvironment and EvaluationContext into Environment. Have a notion of Frame for the bindings + parent + mutability. Replace the updateAndPropagate mechanism by a dynamicFrame. Simplify ValidationEnvironment, that is now always deduced from the Environment. -- MOS_MIGRATED_REVID=102363438
* When a Skylark macro creates a native rule, it also sets the following rule ↵Gravatar Florian Weikert2015-09-02
| | | | | | | attributes: generator_{function, name, location} -- MOS_MIGRATED_REVID=102139196
* Move global objects to RuntimeGravatar Francois-Rene Rideau2015-08-31
| | | | | | | | Move away global constants and global namespaces out of Environment and into a new file Runtime. -- MOS_MIGRATED_REVID=101940218
* Fixes to Skylark function callGravatar Francois-Rene Rideau2015-08-31
| | | | | | | | Allow a call to a struct's field when it's a function. Check whether a java method exists before issuing KwArg error. -- MOS_MIGRATED_REVID=101937143
* Roll back "When a Skylark macro creates a native rule, it also..."Gravatar Michajlo Matijkiw2015-08-31
| | | | | -- MOS_MIGRATED_REVID=101798931
* When a Skylark macro creates a native rule, it also sets the following rule ↵Gravatar Florian Weikert2015-08-28
| | | | | | | attributes: generator_{function, name, location} -- MOS_MIGRATED_REVID=101774632
* Skylark stack traces are now displayed in Python format.Gravatar Florian Weikert2015-08-27
| | | | | -- MOS_MIGRATED_REVID=101572295
* Rename isSkylarkEnabled to isSkylarkGravatar Francois-Rene Rideau2015-08-26
| | | | | -- MOS_MIGRATED_REVID=101518833
* Skylark error messages now include a stack trace.Gravatar Florian Weikert2015-08-20
| | | | | | | This means that some tests had to be changed from using exact equality of error messages to working with contains() / startsWith(). -- MOS_MIGRATED_REVID=100923593
* Renamed Ident to Identifier, added some helper methods and refactored two ↵Gravatar Florian Weikert2015-07-23
| | | | | | | methods. -- MOS_MIGRATED_REVID=98922811
* 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
* Clean up exception handling in DotExpression and FuncallExpression.Gravatar Laurent Le Brun2015-05-21
| | | | | | | | Factor the exception handling where possible. Also, don't print the exception name in error messages. -- MOS_MIGRATED_REVID=94083727
* BUILD language: Improve error message when using operator [].Gravatar Laurent Le Brun2015-05-21
| | | | | -- MOS_MIGRATED_REVID=93977184
* Improve the way a FuncallExpression is printed while debugging.Gravatar Francois-Rene Rideau2015-05-18
| | | | | -- MOS_MIGRATED_REVID=93908545
* Remove old Skylark Function hierarchyGravatar Francois-Rene Rideau2015-04-23
| | | | | | | Last step in refactoring of Skylark builtin functions. -- MOS_MIGRATED_REVID=91796746
* Migrate SkylarkBuiltin annotations to SkylarkSignature instead.Gravatar Francois-Rene Rideau2015-04-21
| | | | | -- MOS_MIGRATED_REVID=91603959
* Skylark: Remove static type checksGravatar Laurent Le Brun2015-04-15
| | | | | -- MOS_MIGRATED_REVID=91175430
* Skylark: Remove static type checking of variables/functions.Gravatar Laurent Le Brun2015-04-13
| | | | | | | | There are still some static checks (check existence of variable/function, readonly variables, etc.). More cleanup will come later. -- MOS_MIGRATED_REVID=90979748
* Skylark: Allow list slicesGravatar Laurent Le Brun2015-03-16
| | | | | -- MOS_MIGRATED_REVID=88727892
* Misc Skylark cleanups and small featuresGravatar Francois-Rene Rideau2015-03-10
| | | | | -- MOS_MIGRATED_REVID=88224368
* Some cleanup changes.Gravatar Ulf Adams2015-03-05
| | | | | -- MOS_MIGRATED_REVID=87821306
* Skylark: fix auto type conversion between the BUILD language and Skylark. ↵Gravatar Googler2015-03-05
| | | | | | | SkylarkList#toList() behaves consistently for all implementations. -- MOS_MIGRATED_REVID=87817550
* Introduce first class function signatures; make the parser use them.Gravatar Francois-Rene Rideau2015-02-19
| | | | | | | | | | | | | | | | | | | This is the first meaty cl in a series to refactor the Skylark function call protocol. 1- We introduce a first-class notion of FunctionSignature, that supports positional and named-only arguments, mandatory and optional, default values, type-checking, *stararg and **kwarg; 2- To keep things clean, we distinguish two different kinds of Argument's: Argument.Passed that appears in function calls, and Parameter, that appears in function definitions. 3- We refactor the Parser so it uses this infrastructure, and make minimal changes to MixedModeFunction so that it works with it (but don't actually implement *starparam and **kwparam yet). 4- As we modify FuncallExpression, we ensure that the args and kwargs arguments it passes to the underlying function are immutable, as a prerequisite to upcoming implementation of *starparam and **kwparam as being provided directly from a skylark list or dict. Further changes under review will take advantage of this FunctionSignature to redo all our function call protocol, to be used uniformly for both UserDefinedFunction's and builtin function. The result will be a simpler inheritance model, with better type-checking, builtin functions that are both simpler and better documented, and many redundant competing functionality-limited codepaths being merged and replaced by something better. NB: The changes to MixedModeFunction, SkylarkFunction and MethodLibrary are temporary hacks to be done away with in an upcoming CL. The rest is the actual changes. -- MOS_MIGRATED_REVID=86704072
* 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
* Skylark: Validate function arguments.Gravatar Laurent Le Brun2015-02-11
| | | | | -- MOS_MIGRATED_REVID=86087783
* Update from Google.Gravatar Han-Wen Nienhuys2015-02-25
-- MOE_MIGRATED_REVID=85702957