-
Notifications
You must be signed in to change notification settings - Fork 10.5k
SyntaxNodes: subsume DotSelfExpr and ImplicitMemberExpr by MemberAccessExpr. #21953
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
Conversation
@swift-ci please smoke test |
token_choices=[ | ||
'PeriodToken', 'PrefixPeriodToken' | ||
]), | ||
Child('SelfKeyword', kind='SelfToken'), | ||
## Name could be 'self' | ||
Child("Name", kind='Token'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you distinguish foo.self
and foo.`self`
?
struct Foo {
var `self`: Int { return 0 }
}
let f = Foo()
print(f.self)
print(f.`self`)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I mean, yes, hopefully no one does this, but the compiler and language support it.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`self`
is currently parsed as one token so the structure still applies. It's parsed to be something like: <MemberAccessExpr><IdentifierExpr>f</IdentifierExpr>.`self`</MemberAccessExpr>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, `self`
and self
are different tokens, even though they have the same identifier text.
@swift-ci please smoke test |
97b9972
to
c9c7fe5
Compare
@swift-ci please smoke test |
…ssExpr. Per our discussion in another PR, having these three similar nodes at the same time may unnecessarily complicate client side.
c9c7fe5
to
d4ecf80
Compare
@swift-ci please smoke test |
Per our discussion in another PR, having these three similar nodes at
the same time may unnecessarily complicate client side.