Skip to content

Conversation

SIGMazer
Copy link
Member

Description

This pull request introduces changes to support type modifiers for function parameters in the ast.c and ast.h files. The changes include updating the Parameter structure and modifying relevant functions to handle the new TypeModifiers field.

Changes to support type modifiers:

  • ast.c: Updated the create_parameter function to include a TypeModifiers mods parameter and modified the enter_function_scope function to use the modifiers field from the Parameter structure instead of the get_current_modifiers function. [1] [2] [3]

  • ast.h: Added a TypeModifiers modifiers field to the Parameter structure and updated the create_parameter function signature to include the TypeModifiers mods parameter. [1] [2]

Changes to function call handling:

  • lang.y: Updated the param_list grammar rule to include optional modifiers and pass them to the create_parameter function.

Test case and expected results updates:

Related Issue

fixes: #97

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
  • Refactor

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)
  • I have run the unit tests locally
  • I have run the valgrind memory tests locally
  • All new and existing tests pass

@SIGMazer SIGMazer added enhancement New feature or request tests Testing examples and edge cases labels Feb 15, 2025
@SIGMazer SIGMazer requested a review from leo-aa88 as a code owner February 15, 2025 18:12
Signed-off-by: SIGMazer <mazinasd7@gmail.com>
Signed-off-by: SIGMazer <mazinasd7@gmail.com>
@SIGMazer SIGMazer force-pushed the feat/func_type_modifier branch from 3b4efea to 2cea433 Compare February 15, 2025 19:39
@SIGMazer SIGMazer added the CI Continuous integration label Feb 15, 2025
@leo-aa88
Copy link
Member

niiiiice!

@SIGMazer SIGMazer merged commit 7bdd66e into main Feb 16, 2025
2 checks passed
@SIGMazer SIGMazer deleted the feat/func_type_modifier branch February 16, 2025 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous integration enhancement New feature or request tests Testing examples and edge cases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for type modifiers in user-defined functions
2 participants