Skip to content

Add color to tasty printer #3529

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 23, 2017
Merged

Conversation

nicolasstucki
Copy link
Contributor

Makes clear the distinction between name indices, tree indices and tree lengths.

@@ -22,8 +23,8 @@ class TastyPrinter(bytes: Array[Byte])(implicit ctx: Context) {

def printNames() =
for ((name, idx) <- nameAtRef.contents.zipWithIndex) {
val index = "%4d: ".format(idx)
println(index + nameToString(name))
val index = Magenta("%4d".format(idx))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a layer of abstraction, e.g. "NameColor" instead of "Magenta"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do.

Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Makes clear the distinction between name indices, tree indices and tree lengths.
@nicolasstucki nicolasstucki merged commit 6cceefc into scala:master Nov 23, 2017
@allanrenucci allanrenucci deleted the colored-tasty branch December 14, 2017 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants