Skip to content

[ASTDumper] Use consistent coloring. #17959

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 3 commits into from
Jul 15, 2018

Conversation

dan-zheng
Copy link
Contributor

@dan-zheng dan-zheng commented Jul 15, 2018

  • Use consistent coloring for closing parentheses.
    Some colored open parentheses (printed by printCommon) had uncolored closing parenthesis counterparts. Now, all such closing parentheses are colored.

  • Use consistent coloring for ValueDecls (decl=).
    Most instances of decl=were printed with color but some were not.
    Now, all instances of decl= (and the subsequent ValueDecl or ConcreteDeclRef) are printed with color.

  • Miscellaneous.
    Print assign_expr with color (using printCommon).
    Print function_ref for UnresolvedDotExpr with color, to be consistent with all other function_ref printing.

Some colored open parentheses (printed by `printCommon`) had uncolored
closing parenthesis counterparts. Now, all such closing parentheses are
colored.
Most instances of "decl=" were printed with color but some were not.
Now, all instances of "decl=" (and the subsequent ValueDecl or
ConcreteDeclRef) are printed with color.
- Print "assign_expr" with color (using `printCommon`).
- Print "function_ref" for UnresolvedDotExpr with color, to be
consistent with all other "function_ref" printing.
@dan-zheng
Copy link
Contributor Author

dan-zheng commented Jul 15, 2018

I don't believe there are tests for ASTDumper output.

Below is an image showing some before/after changes (before on left, after on right, changes are boxed).

// test.swift
struct S {
  let int: Int
}

let a = (1, 2, 3)
a.0

#selector(MyViewController.tappedButton)

I ran swiftc -dump-ast test.swift before and after.
ast-dumper-colors

@dan-zheng
Copy link
Contributor Author

@swift-ci Please smoke test

@CodaFi
Copy link
Contributor

CodaFi commented Jul 15, 2018

Thanks!

⛵️

@CodaFi CodaFi merged commit 6de160c into swiftlang:master Jul 15, 2018
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.

2 participants