Skip to content

WIP enumerate node_choices and element_choices #765

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

Closed
wants to merge 1 commit into from

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Sep 9, 2022

NO NOT MERGE

Comment on lines 8430 to +8738
public struct AttributeSyntax: SyntaxProtocol, SyntaxHashable {
public enum Argument: SyntaxProtocol {
case `identifier`(TokenSyntax)
case `string`(TokenSyntax)
case `integer`(TokenSyntax)
Copy link
Member Author

Choose a reason for hiding this comment

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

This is unfortunate we need to take the token kind into account.

}
}
init(_ data: SyntaxData) { self.init(Syntax(data))! }
public init(decl node: DeclSyntax) { self = .decl(node) }
Copy link
Member

Choose a reason for hiding this comment

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

I think it would also be useful to have

public init<T: DeclSyntaxProtocol>(decl node: T) 

so you can initialize .decl with any decl node without needing to upcast it to DeclSyntax first.

@rintaro rintaro force-pushed the choices-enum branch 2 times, most recently from 5a68117 to 7758920 Compare September 21, 2022 06:24
@rintaro
Copy link
Member Author

rintaro commented Oct 24, 2022

Superseded by #1010

@rintaro rintaro closed this Oct 24, 2022
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