Skip to content
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

feat: add support for arrays #65

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

araujo88
Copy link
Member

@araujo88 araujo88 commented Jan 14, 2025

Description

Add support for rizz, smol, cap, yap, chad and gigachad arrays.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Performance improvement

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have documented my changes in the code or documentation
  • I have added tests that prove my changes work (if applicable)
  • All new and existing tests pass

@araujo88 araujo88 added the enhancement New feature or request label Jan 14, 2025
Comment on lines 2049 to +2061
case NODE_OPERATION:
case NODE_UNARY_OPERATION:
case NODE_INT:
case NODE_ARRAY_ACCESS:
if (node->data.array.name && node->data.array.index)
{
int length = node->data.array.index->data.ivalue;
if (!set_array_variable(node->data.array.name, length, node->modifiers, node->var_type))
{
yyerror("Failed to create array");
}
}
break;
Copy link
Contributor

@SIGMazer SIGMazer Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is what makes the test fail it reference to null when the node type is unary.

you can move this

case NODE_OPERATION:
    case NODE_UNARY_OPERATION:
    case NODE_INT:

after the NODE_ARRAY_ACCESS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants