-
Notifications
You must be signed in to change notification settings - Fork 234
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
Add syntax for escaped field selectors. #1002
Conversation
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 like this as a first approach at relaxing the syntax to support escapes need for fields named after reserved words and for supporting proto extension fields natively.
The type-checker should continue to validate field names which is great, and there's no weirdness with invalid function names, just escaping on the namespaces. It seems to help satisfy a common pain point. It might not solve top-level .in domains within namespace names, but it's a great start.
Introduces syntax for escaped fields that are not normally syntactically legal field selections with backticks. This PR is limited to fields, but would also consider adding for namespaced names (e.g. `in.example.Foo`)
6276641
to
e80d1af
Compare
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.
LGTM. My questions which can be addressed post-submission.
29deeb6
to
2222aa9
Compare
Introduces syntax for escaped fields that are not normally syntactically legal field selections with backticks.
This slightly relaxes the parse requirements for fields to cover more types of field like keys e.g.
This PR is limited to fields, but we could consider generalizing to cover namespaced names and simple identifier for variables in a later update (e.g.
in.example.Foo
orpackage
)