aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/syntax
Commit message (Collapse)AuthorAge
* Forbid duplicate keys in dictionary literalsGravatar laurentlb2017-09-07
| | | | | | | RELNOTES: When using the dictionary literal syntax, it is now an error to have duplicated keys (e.g. {'ab': 3, 'ab': 5}). PiperOrigin-RevId: 167750614
* 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
* Remove general list typeGravatar michajlo2017-09-06
| | | | | | AFAICT this is unused, remove before it becomes used. PiperOrigin-RevId: 167616353
* 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
* Fix assorted ErrorProne warnings.Gravatar lberki2017-09-06
| | | | | RELNOTES: None. PiperOrigin-RevId: 167574104
* 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
* Enable by default the flag incompatible_checked_arithmetic.Gravatar laurentlb2017-09-04
| | | | | | | RELNOTES[INC]: Integer overflow (on signed 32 bit numbers) in BUILD/bzl files is an error. PiperOrigin-RevId: 167486707
* Bazel/syntax: Delete/inline Statement.execGravatar laurentlb2017-09-04
| | | | | RELNOTES: None. PiperOrigin-RevId: 167300232
* 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
* Add a way to construct Frames in a two-step processGravatar brandjon2017-08-29
| | | | | RELNOTES: None PiperOrigin-RevId: 166857589
* Flip the --incompatible_disallow_set_constructor flag by defaultGravatar vladmos2017-08-29
| | | | | | | | | RELNOTES[INC]: `set` is deprecated in BUILD and .bzl files, please use `depset` instead. Ordering names have also been changed, please use "default", "postorder", "preorder", and "topological" instead of "stable", "compile", "naive_link", and "link" correspondingly. PiperOrigin-RevId: 166830004
* 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
* Flip the --incompatible_descriptive_string_representations flag by defaultGravatar vladmos2017-08-28
| | | | | | | | RELNOTES[INC]: Objects in Skylark are converted to strings in a more descriptive and less harmful way (they don't leak information that shouldn't be accessed by Skylark code, e.g. nondeterministic memory addresses of objects). PiperOrigin-RevId: 166697907
* Move Statement.exec methods to a separate class.Gravatar laurentlb2017-08-28
| | | | | RELNOTES: None. PiperOrigin-RevId: 166689144
* Add a visitor method for statement blocks to SyntaxTreeVisitorGravatar fzaiser2017-08-28
| | | | | | | | | This allows to do an action after every statement in a block (e.g. an else-block) without having to override all visit(...) methods related to statements. RELNOTES: None PiperOrigin-RevId: 166483743
* Make tests independent of the current state of the ↵Gravatar vladmos2017-08-28
| | | | | | incompatible_descriptive_string_representations flag PiperOrigin-RevId: 166475260
* Introduce enum to quickly discriminate AST nodes.Gravatar laurentlb2017-08-25
| | | | | RELNOTES: None. PiperOrigin-RevId: 166370036
* Update documentation for the print functionGravatar vladmos2017-08-24
| | | | | | Print function prints debug messages, not warnings. PiperOrigin-RevId: 166212471
* 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
* 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
* Rename Scope to LexicalBlock, and other cleanup in ValidationEnvironment.Gravatar laurentlb2017-08-18
| | | | | RELNOTES: None. PiperOrigin-RevId: 165600058
* Remove validate() methods in the AST, use a visitor instead.Gravatar laurentlb2017-08-18
| | | | | | | This is a simple refactoring, no change in behavior. RELNOTES: None. PiperOrigin-RevId: 165572028
* Delete cachedSymbols from LoadStatement.Gravatar laurentlb2017-08-18
| | | | | | | We rarely need it, it's not useful to keep it in memory. RELNOTES: None. PiperOrigin-RevId: 165562119
* Fix NPE in PrinterGravatar brandjon2017-08-17
| | | | | RELNOTES: None PiperOrigin-RevId: 165489091
* Simplify validation environment (futureReadOnlyVariables is not needed).Gravatar laurentlb2017-08-17
| | | | | RELNOTES: None. PiperOrigin-RevId: 165477209
* Make `incompatible_disallow_toplevel_if_statement` default to true.Gravatar laurentlb2017-08-17
| | | | | RELNOTES: Top-level `if` statements are now forbidden. PiperOrigin-RevId: 165469101
* Refactoring: create only one ValidationEnvironmentGravatar laurentlb2017-08-17
| | | | | | | | After this change, it will be easier to move the validate() methods to a separate visitor. RELNOTES: None. PiperOrigin-RevId: 165467838
* 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
* Remove methods that shouldn't belong to FuncallExprGravatar fzaiser2017-08-17
| | | | | RELNOTES: None PiperOrigin-RevId: 165419360
* Remove unused methods from FunctionSignatureGravatar brandjon2017-08-16
| | | | | RELNOTES: None PiperOrigin-RevId: 165177605
* SyntaxTreeVisitor handles flow statements (break / continue).Gravatar laurentlb2017-08-14
| | | | | RELNOTES: None. PiperOrigin-RevId: 165159163
* 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
* Fix AST visitor for for loops and comprehensions.Gravatar laurentlb2017-08-11
| | | | | RELNOTES: None. PiperOrigin-RevId: 164893252
* Make the print function output debug messagesGravatar vladmos2017-08-11
| | | | | RELNOTES: The `print` function now prints debug messages instead of warnings. PiperOrigin-RevId: 164880003
* Cleanup SkylarkDict APIGravatar brandjon2017-08-10
| | | | | | | Reorder a few methods, change some mutators to take Mutability instead of Environment, make it clear that the casting methods return read-only maps (which may be views). Also make putAll/putAllUnsafe public with an appropriately scary javadocs. RELNOTES: None PiperOrigin-RevId: 164776346
* Cleanup cast methods for SkylarkListGravatar brandjon2017-08-10
| | | | | | | Ensure that the casted list is unmodifiable (both for mutability correctness and also type correctness), and clearly document this. RELNOTES: None PiperOrigin-RevId: 164739837
* 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
* In the MutableList API, make an internal unsafe method publicGravatar brandjon2017-08-10
| | | | | | | This method acts as an "escape hatch" for mutating a list regardless of Mutability. It should be avoided if at all possible. RELNOTES: None PiperOrigin-RevId: 164716286
* Improve SyntaxTreeVisitor API.Gravatar laurentlb2017-08-08
| | | | | RELNOTES: None. PiperOrigin-RevId: 164481927
* Use Iterators.unmodifiableIterator() for readabilityGravatar brandjon2017-08-08
| | | | | RELNOTES: None PiperOrigin-RevId: 164457611
* 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
* Make selector list construction n^2 -> n efficient.Gravatar gregce2017-08-07
| | | | | | | | | | | | | | | On the subject of simpler toString output (i.e. "selector" vs. "selector({dictionary contents here})", I'm not changing that here because there are consistency concerns. BuildType.SelectorList.toString is defined to match lib.syntax.SelectorList's Skylark serialization. That follows a standard pattern defined here: https://github.com/bazelbuild/bazel/blob/67bd6fc6354f2abbbc149fcd0120228b538842d3/src/main/java/com/google/devtools/build/lib/skylarkinterface/SkylarkValue.java#L37 which has concerns about deserialization. If you want to take this further we can discuss with the Skylark devs. PiperOrigin-RevId: 164311511