aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/syntax/PrinterTest.java
Commit message (Collapse)AuthorAge
* Add option to restrict format strings to %sGravatar brandjon2018-04-04
| | | | | | | This is useful for contexts like ctx.actions.args()'s methods, where %d and %r aren't appropriate placeholders. RELNOTES: None PiperOrigin-RevId: 191629195
* Remove deprecated legacy string representations of Skylark objectsGravatar vladmos2017-10-13
| | | | | | | | RELNOTES[INC]: The flag --incompatible_descriptive_string_representations is no longer available, old style string representations of objects are not supported anymore. PiperOrigin-RevId: 171952621
* Fix NPE in PrinterGravatar brandjon2017-08-17
| | | | | RELNOTES: None PiperOrigin-RevId: 165489091
* 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
* 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
* Refactor PrinterGravatar vladmos2017-07-03
| | | | | | | It's now easier to customize Printer if in different situations objects should be printed differently. Also its API is cleaner now. Names of methods of SkylarkValue objects now reflect names of Skylark functions: SkylarkValue#repr and SkylarkPrintableValue#str. PiperOrigin-RevId: 160635154
* Migrate Java tests to Truth.Gravatar lberki2017-05-30
| | | | | | RELNOTES: None. PiperOrigin-RevId: 157446717
* Do not sort dict keys when printingGravatar Vladimir Moskva2017-02-17
| | | | | | | | | | Dict keys can in theory belong to different types, it's not allowed anymore to compare such objects by < in Skylark, so the Printer class shouldn't do it either. -- PiperOrigin-RevId: 147827109 MOS_MIGRATED_REVID=147827109
* 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
* 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
* Move Label from the lib.syntax to the lib.cmdline package so that:Gravatar Lukacs Berki2015-09-21
| | | | | | | | | | - Label parsing can be simplified - lib.syntax is only contains the code for Skylark and is reasonably independent from the problem domain of building things This change is mostly only changes to imports declarations. The rest is reversing the dependency between :cmdline and :syntax and moving a tiny amount of code between Printer and FilesetEntry and the addition of SkylarkPrintableValue that I couldn't be bothered to separate out into its own change. -- MOS_MIGRATED_REVID=103527877
* Separate build-specific types and types inherent to Skylark.Gravatar Lukacs Berki2015-09-21
| | | | | -- MOS_MIGRATED_REVID=103374106
* Parse the label syntax "@//a:b" so that eventually we can make that the ↵Gravatar Lukacs Berki2015-09-15
| | | | | | | | | syntax that means "refer to the main repository". There isn't an overarching plan for what we are going to do with the cmdline package, which seems to be separated from the .syntax one in all sorts of awkward ways. -- MOS_MIGRATED_REVID=103088960
* 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
* 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
* Changes related to the order of Skylark dictionaries:Gravatar Florian Weikert2015-08-04
| | | | | | | | | - Objects of different types can now be compared. - Printer now prints dictionaries in a deterministic order, even when the keys have different types. - testEval() in EvaluationTestCases evaluates both expressions instead of comparing expression strings. Consequently, if a statement describes a collection, its order does no longer matter when doing the comparison. -- MOS_MIGRATED_REVID=99829458
* Printer can be configured to use single quotation marks instead of double ↵Gravatar Florian Weikert2015-07-01
| | | | | | | quotation marks -- MOS_MIGRATED_REVID=97320494
* Rollback of commit 13ef26d0817a429bf214d3dc4c5551e616e403fe.Gravatar Laurent Le Brun2015-06-30
| | | | | | | | | | | | | | | | | *** Reason for rollback *** Breaks 'blaze query' *** Original change description *** Skylark: write labels readably Write a label as Label("//x:x") instead of merely "//x:x", so it can be read and evaluated back, as per the Python convention. However, the OutputFormatter for BUILD files still needs to output "//x:x". -- MOS_MIGRATED_REVID=97156166
* Skylark: write labels readablyGravatar Francois-Rene Rideau2015-06-18
| | | | | | | | | Write a label as Label("//x:x") instead of merely "//x:x", so it can be read and evaluated back, as per the Python convention. However, the OutputFormatter for BUILD files still needs to output "//x:x". -- MOS_MIGRATED_REVID=96209979
* 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
* Default Android dependencies to a //external: label with a default binding ↵Gravatar Lukacs Berki2015-06-16
| | | | | | | | | | | | | | | | to //tools/android: . This is useful because we can then eventually implement an android_tools_repository() rule that lets Bazel download the Android tools from somewhere instead of requiring it to be in every workspace with Android tools. The number of tools here is somewhat scary, therefore, I'm considering creating an android_tools rule which would have an attribute for each of these things. Some non-trivial things about this CL: - The labels to load are removed from AndroidConfiguration because they would resolve to e.g. //external:dx_jar, which labels just don't exist and I don't want to add dummy //external:labels not prefixed with android_ - RedirectChaser is taught how to chase redirect through bind() rules because the Android SDK is now found by //external:android_sdk -> //tools/android:sdk -> @androidsdk//:sdk . Ideally, it would be ///external:android_sdk -> @androidsdk//:sdk, but I figured I'd not fix that in this CL. -- MOS_MIGRATED_REVID=96080553
* 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