Skip to content
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

[SR-6931] libSyntax: StmtSyntax doesn't capture commonality among statements #49479

Closed
dabrahams opened this issue Feb 6, 2018 · 6 comments
Closed
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. † libswiftSyntax † Area → compiler: the once-integrated C++ Syntax library succeeded by SwiftSyntax QoI Quality of Implementation source tooling Area: IDE support, SourceKit, and other source tooling stale Resolution: No longer relevant, stale statements Feature: statements

Comments

@dabrahams
Copy link
Collaborator

Previous ID SR-6931
Radar None
Original Reporter @dabrahams
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Source Tooling
Labels Bug, Syntax
Assignee None
Priority Medium

md5: 931699f91fdd0d36b66d61e8d1c5d28e

Issue Description:

For example, you can't ask whether any of the statements in a StmtListSyntax ends with a semicolon without downcasting each one.

@rintaro
Copy link
Mannequin

rintaro mannequin commented Feb 6, 2018

As for this specific issue, I personally would like to change this like:

// Items in code block. (ASTNode in libAST)
Node(name="CodeBlockItem", kind="Syntax",
     child=[
       Child("Item", kind="Syntax", node_choices=["Decl", "Stmt", "Expr"])
       Child("Semicolon", kind="SemicolonToken", is_optional=True)
     ])

@nkcsgexi, what do you think?

@nkcsgexi
Copy link
Member

nkcsgexi commented Feb 6, 2018

I think it makes sense.

@rintaro
Copy link
Mannequin

rintaro mannequin commented Feb 7, 2018

#14458 for CodeBlockItem

@nkcsgexi
Copy link
Member

We added a general mechanism to declare commonality.

2b61d4e

@dabrahams
Copy link
Collaborator Author

Please see my remarks here

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added source tooling Area: IDE support, SourceKit, and other source tooling QoI Quality of Implementation statements Feature: statements labels Apr 5, 2023
@AnthonyLatsis
Copy link
Collaborator

libSyntax was removed in #62145 and succeeded by swift-syntax.

@AnthonyLatsis AnthonyLatsis closed this as not planned Won't fix, can't repro, duplicate, stale Apr 5, 2023
@AnthonyLatsis AnthonyLatsis added the stale Resolution: No longer relevant, stale label Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. † libswiftSyntax † Area → compiler: the once-integrated C++ Syntax library succeeded by SwiftSyntax QoI Quality of Implementation source tooling Area: IDE support, SourceKit, and other source tooling stale Resolution: No longer relevant, stale statements Feature: statements
Projects
None yet
Development

No branches or pull requests

3 participants