Skip to content

[Parse] Add back TrailingSemiLoc to Expr, Stmt, and Decl #6979

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 7 commits into from
Jan 23, 2017

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Jan 23, 2017

Follow up on #6005 (comment) .

Add back TrailingSemiLoc to Expr, Stmt, and Decl.
To correctly accomplish this, I modified parseDecl() to return ParserResult<Decl> with the significant decl. For instance, let (x, y) = (1, 2); produces 3 decls:

(pattern_binding_decl
  (pattern_tuple (pattern_named 'a') (pattern_named 'b'))
  (tuple_expr ...))
(var_decl "a")
(var_decl "b")

Before #6005, the trailing semi-colon was attached to (var_decl "b") the last decl.
In this change, parseDecl() returns PatternBindingDecl so that the semi-colon can be attached to it.

Also, modified ASTDumper to print trailing_semi for Expr, Stmt, and Decl if they have trailing semi-colon.

@rintaro
Copy link
Member Author

rintaro commented Jan 23, 2017

CC @bitjammer

@rintaro
Copy link
Member Author

rintaro commented Jan 23, 2017

@swift-ci Please smoke test

@bitjammer
Copy link
Contributor

SUPER.

@bitjammer bitjammer merged commit 839221a into swiftlang:master Jan 23, 2017
@bitjammer
Copy link
Contributor

Thank you, @rintaro!

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