-
Notifications
You must be signed in to change notification settings - Fork 616
Replace Method
and CompositeAccess
with CompoundFieldAccess
#1716
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
FYI @goldmedal |
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.
Thanks @iffyio 👍. It looks good to me. I think it's a nice improvement to remove the duplicate definition.
let expr = dialects.verified_expr( | ||
"CONVERT(XML, '<Book>abc</Book>').value('.', 'NVARCHAR(MAX)').value('.', 'NVARCHAR(MAX)')", | ||
); | ||
match expr { | ||
Expr::Method(Method { expr, method_chain }) => { | ||
assert!(matches!(*expr, Expr::Convert { .. })); | ||
Expr::CompoundFieldAccess { root, access_chain } => { |
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.
it is nice to have a unified AST representation here
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.
Thanks @iffyio
I read through this PR -- and reviewed the test changes carefully. While I don't claim to understand all of the code, it looks quite a bit nicer and cleaner to me. 🚀
Thank you very much. Nice work
Also thank you @goldmedal for the review
Thanks for the reviews @alamb @goldmedal 🙏 |
Looks like this needs a merge up from main to resolve some conflicts |
Yeah I'll resolve the conflicts! |
b1a60fb
to
3283d6e
Compare
Continuation of #1551
This moves over two of the special case compound expressions delimited by period to use the new
CompoundFieldAccess
representation.It moves the logic to parse the various kinds of compound expression into the same function
parse_compound_expr
, where previously they were somewhat spread between individual expression parsing and the compound field access parsing.