aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/syntax
Commit message (Collapse)AuthorAge
* Check parameter types for methods when multiple types are allowed.Gravatar dslomov2017-09-20
| | | | | | Fixes #3714 RELNOTES: None. PiperOrigin-RevId: 169382686
* Move RuleConfiguredTarget to lib.analysis.configuredtargets.Gravatar gregce2017-09-19
| | | | | | This is a trivial change with a large file footprint. PiperOrigin-RevId: 169169864
* Project reorg: move *ConfiguredTarget to new configuredtargets/ pathGravatar gregce2017-09-18
| | | | | | | Exempt RuleConfiguredTarget in this change because that's liable to touch a billion files. PiperOrigin-RevId: 168929827
* --incompatible_comprehension_variables_do_not_leak defaults to trueGravatar laurentlb2017-09-08
| | | | | | | | RELNOTES[INC]: --incompatible_comprehension_variables_do_not_leak defaults to "true." Iteration variable becomes inaccessible after a list/dict comprehension. PiperOrigin-RevId: 167876119
* Support labels referencing external targets (with '@') in load with ↵Gravatar Kevin Gessner2017-09-07
| | | | | | | | --incompatible_load_argument_is_label enabled (fixes #3560) Closes #3562. PiperOrigin-RevId: 167745885
* incompatible_disallow_keyword_only_args now defaults to trueGravatar laurentlb2017-09-07
| | | | | | | | RELNOTES[INC]: Keyword-only syntax in a function definition is now forbidden e.g. `def foo(a, *, b)` or `def foo(a, *b, c)` PiperOrigin-RevId: 167741296
* Fix crash when calling int(s, 0) where s doesn't specify the radixGravatar brandjon2017-09-06
| | | | | | | Also distinguish between unspecified base arg and base 10, so "int(True, 10)" is now an error. This is an incompatible change, albeit a small one. RELNOTES: None PiperOrigin-RevId: 167616143
* skylark/syntax: Move flow statement check to the validation pass.Gravatar laurentlb2017-09-04
| | | | | | | Mutiple other cleanups in the parser, update code documentation. RELNOTES: None. PiperOrigin-RevId: 167501136
* Remove testFunctionListArgumentsAreImmutable and ↵Gravatar vladmos2017-09-01
| | | | | | | | | | | testFunctionDictArgumentsAreImmutable These tests don't actually check mutability of objects but behavior of += on them. Input arguments of functions are in fact mutable unless they've been created in another mutability scope. There are already other tests that actually check immutability of objects from another mutability scope. PiperOrigin-RevId: 167295711
* Remove the Dialect type from the Parser.Gravatar laurentlb2017-09-01
| | | | | | | | Let's use the same parser. Dialect differences are checked in a separate validation pass. RELNOTES: None. PiperOrigin-RevId: 167280201
* Fix wrong location of string literals in the lexerGravatar fzaiser2017-09-01
| | | | | RELNOTES: none PiperOrigin-RevId: 167263494
* Visit subtrees of the AST in evaluation orderGravatar fzaiser2017-08-29
| | | | | | | | | | | For instance, it makes more sense to visit the RHS of an assignment first because this is evaluated first. This also fixes a bug in the validator, which allowed definitions like "a = a" RELNOTES: None PiperOrigin-RevId: 166709589
* Change Identifier#boundNames to #boundIdentifiers.Gravatar fzaiser2017-08-28
| | | | | RELNOTES: None PiperOrigin-RevId: 166704851
* Make tests independent of the current state of the ↵Gravatar vladmos2017-08-28
| | | | | | incompatible_descriptive_string_representations flag PiperOrigin-RevId: 166475260
* Refactor: Parse return statements without an expression properlyGravatar fzaiser2017-08-24
| | | | | | | | This is an internal refactoring necessary for the Skylark linter. It does not change any behavior. RELNOTES: None PiperOrigin-RevId: 166199367
* Minor refactor of UserDefinedFunction constructor, accessorsGravatar brandjon2017-08-23
| | | | | RELNOTES: None PiperOrigin-RevId: 166149340
* Remove dialect distinction from the parser.Gravatar laurentlb2017-08-22
| | | | | RELNOTES: None. PiperOrigin-RevId: 166058718
* Split Info into SkylarkInfo and NativeInfo.Gravatar dslomov2017-08-22
| | | | | | | | Prerequisite to implementing shape-declaration and shape-sharing for declared providers, and cleaning up NativeInfo interface. RELNOTES: None. PiperOrigin-RevId: 166057070
* Throw a static error when lvalue of an augmented assignment is a list.Gravatar laurentlb2017-08-21
| | | | | | | RELNOTES: When the lvalue of an augmented assignment is a list, we now throw an error before evaluating the code (e.g. `a, b += 2, 3`). PiperOrigin-RevId: 165906611
* Fix NPE in PrinterGravatar brandjon2017-08-17
| | | | | RELNOTES: None PiperOrigin-RevId: 165489091
* Make `incompatible_disallow_toplevel_if_statement` default to true.Gravatar laurentlb2017-08-17
| | | | | RELNOTES: Top-level `if` statements are now forbidden. PiperOrigin-RevId: 165469101
* Fix lexer bug that allowed non-ASCII letters in identifiersGravatar fzaiser2017-08-17
| | | | | RELNOTES: None PiperOrigin-RevId: 165434934
* Delete Literal.javaGravatar laurentlb2017-08-17
| | | | | RELNOTES: None. PiperOrigin-RevId: 165422514
* Fix Skylark parsing of call expressions.Gravatar fzaiser2017-08-14
| | | | | | | | This allows more complex expressions to be called, not just identifiers. For example, "x[0]()" is not a syntax error anymore. RELNOTES: None PiperOrigin-RevId: 165157981
* Refactor FuncallExpression to allow for complex function terms later.Gravatar fzaiser2017-08-14
| | | | | RELNOTES: None. PiperOrigin-RevId: 164981071
* Make the print function output debug messagesGravatar vladmos2017-08-11
| | | | | RELNOTES: The `print` function now prints debug messages instead of warnings. PiperOrigin-RevId: 164880003
* Deprecate old ordering names for depsetsGravatar vladmos2017-08-10
| | | | | | | | | Old ordering names ("stable", "compile", "naive_link", "link") are deprecated and won't be available if --incompatible_disallow_set_constructor=true is set. Use "default", "postorder", "preorder", and "topological" correspondingly instead. PiperOrigin-RevId: 164728439
* Improve SyntaxTreeVisitor API.Gravatar laurentlb2017-08-08
| | | | | RELNOTES: None. PiperOrigin-RevId: 164481927
* 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
* 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
* Better names for declared providers-related classes.Gravatar dslomov2017-08-01
| | | | | | | | Follows https://docs.google.com/document/d/1aAIVWvHPERDz2cv_PCFGwr8dvh5FcAkENFoRsNS4clk/. RELNOTES: None. PiperOrigin-RevId: 163728291
* 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
* 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 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
* 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
* Make native declared providers type-safe.Gravatar dslomov2017-07-10
| | | | | RELNOTES: None. PiperOrigin-RevId: 161395570
* 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
* 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
* 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
* Allow strings as default values of labelsGravatar vladmos2017-07-05
| | | | | | | Strings now can be passed to the default parameter of attr.label, attr.label_list, and attr.label_keyed_string_dict. PiperOrigin-RevId: 160896987
* 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