Add syntax for escaped field selectors.#1002
Merged
Merged
Conversation
TristonianJones
left a comment
Collaborator
There was a problem hiding this comment.
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`)
jnthntatum
force-pushed
the
cel-escaped-idents
branch
from
December 10, 2024 17:43
6276641 to
e80d1af
Compare
jnthntatum
marked this pull request as ready for review
December 10, 2024 21:46
TristonianJones
previously approved these changes
Dec 13, 2024
TristonianJones
left a comment
Collaborator
There was a problem hiding this comment.
LGTM. My questions which can be addressed post-submission.
2 tasks
jnthntatum
force-pushed
the
cel-escaped-idents
branch
from
December 13, 2024 19:23
29deeb6 to
2222aa9
Compare
TristonianJones
approved these changes
Dec 13, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.Fooorpackage)