-
Notifications
You must be signed in to change notification settings - Fork 32
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
Cooked giga up #123
base: main
Are you sure you want to change the base?
Cooked giga up #123
Conversation
You implemented |
Take your time to cook, no rush. And thanks for being willing to grind like a true sigma. Reach out on Discord if you need some guidance on this issue. |
a9037a8
to
f49245a
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.
i think the errors because you edit the code of array access
Yeah, I didn't understand how Value works. Now it's doing what I was expecting |
@dominik-air do you need some help with this? |
@dominik-air You can reduce the scope of the PR to make it just cover one of the modifiers. i think it will be simpler |
Indeed, it is better to keep PRs as granular as possible. |
@SIGMazer Agreed. This will be just a @araujo88 Help is always appreciated. I kinda tried to refactor some parts to reduce code duplication and this took me a while to implement without new bugs coming up. I still need to work on the "promotion" and node operations for those new types. |
Dockerfile
Outdated
@@ -0,0 +1,16 @@ | |||
FROM ubuntu:latest |
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 compile and run brainrot inside a Docker container because I wasn't able to make it work on my Mac. Maybe this could be a future addition to the codebase to ease the setup process. Wdyt @araujo88 @SIGMazer
Of course a separate MR would be better for this contribution. I'll remove this in the final MR
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.
yup also i was thinking of add docker container to test the interpreter in other OS
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.
btw what the problem in mac os? maybe we can solve 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.
tbh I don't even remember what was the issue, since I first came across brainrot some weeks ago
I just went with a Docker container because it was less fuss
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.
Fair! If you try it and it has an issue please open an issue with the error
#include <float.h> | ||
#include <stdint.h> |
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.
Unused includes
@@ -1081,6 +1118,52 @@ void *handle_unary_expression(ASTNode *node, void *operand_value, int operand_ty | |||
} | |||
} | |||
|
|||
Value retrieve_array_access_value(ASTNode *node, Value default_return_value) |
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 wanted to reduce code duplication, so I extracted the array access code into this function
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.
about think i was planing to refactor it in some sort of look up table so it will be like this
get_value[var->type](array_data, idx);
i think this will make it easy for us when implementing pointers and multi-N arrays
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.
yup, good idea, but for now I just wanted to clean up a little bit
Description
Related Issue
Resolves #125
Type of Change
Checklist