-
Notifications
You must be signed in to change notification settings - Fork 94
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 struct literal support #1462
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #1462 +/- ##
==========================================
- Coverage 92.16% 92.14% -0.03%
==========================================
Files 669 670 +1
Lines 23676 23806 +130
==========================================
+ Hits 21821 21936 +115
- Misses 1855 1870 +15
... and 25 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
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.
This PR is fine but we should against discuss something, specifically struct access and using child vector for list
std::make_unique<ParsedFunctionExpression>(common::STRUCT_PACK_FUNC_NAME, ctx.getText()); | ||
for (auto& structField : ctx.oC_StructField()) { | ||
auto structExpr = transformExpression(*structField->oC_Expression()); | ||
structExpr->setAlias(transformSymbolicName(*structField->oC_SymbolicName())); |
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.
We probably need to discuss how to access a field from a struct. That part is currently missing and might be tricky to do.
copyNonNullDataWithSameType(resultVector.dataType, srcData, | ||
resultVector.getData() + pos * resultVector.getNumBytesPerValue(), | ||
resultVector.getOverflowBuffer()); | ||
if (resultVector.dataType.typeID == STRUCT) { |
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.
now that you are changing this. I think we should discuss how LIST can be done in a similar fashion. ideally this copyInto and copyFrom should be handled with
switch typeID
recursive types:
...
non recursive types:
...
@ray6080 should think about this as well.
5c7b119
to
bdf82f5
Compare
bdf82f5
to
8dc4439
Compare
Add struct literal support.
Example: return {weight: 5, height: 20}
will return a struct with '{weight: 5, height: 20}'