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

Implemented index-based array assignments #677

Conversation

Luna-Klatzer
Copy link
Member

@Luna-Klatzer Luna-Klatzer commented Jul 22, 2024

What type of change does this PR perform?

  • Info or documentation change (Non-breaking change that updates repo info files (e.g. README.md, CONTRIBUTING.md, etc.) or online documentation)
  • Website (Change that changes the design or functionality of the websites or docs)
  • Development or internal changes (These changes do not add new features or fix bugs, but update the code in other ways)
  • Bug fix (Non-breaking change which fixes an issue)
  • New feature (Non-breaking change which adds functionality)
  • Breaking change (Major bug fix or feature that would cause existing functionality not to work as expected.)
  • Requires a documentation update, as it changes language or compiler behaviour

Summary

Implemented support for index-based array assignment expressions, which allow the modification of individual parts of an array.

Closes #669

Detailed Changelog

Not present for website/docs changes

Added

  • Support for index-based array assignments. (#669)
  • New type BuiltInReference, which replaces the now removed type Reference in the KipperProgramContext for reference tracking of built-in types.
  • New Properties:
    • BuiltInFunction.funcType, which returns a function type for the built-in function.
    • FunctionDeclarationTypeSemantics.type, which returns the type of the function declaration i.e. the function type.
    • LambdaPrimaryExpressionTypeSemantics.type, which returns the type of the lambda primary expression i.e. the
      function type.

Changed

  • Renamed module compiler/.../expressions/arithmetic to arithmetic-expression.

Fixed

  • All functions and lambdas simply resolving to Func instead of the appropriate filled-up Func<T..., R> type. This now enables proper type checking for function references.

Removed

  • Type Reference as it is no longer needed and has been replaced by KipperReferenceable.

Does this PR create new warnings?

None.

Linked issues or PRs

@Luna-Klatzer Luna-Klatzer added the feature New feature or enhancement label Jul 22, 2024
@Luna-Klatzer Luna-Klatzer added this to the v0.12.0 milestone Jul 22, 2024
@Luna-Klatzer Luna-Klatzer requested review from lorenzholzbauer, ByteWolf-dev and a team July 22, 2024 14:50
@Luna-Klatzer Luna-Klatzer self-assigned this Jul 22, 2024
@Luna-Klatzer Luna-Klatzer linked an issue Jul 22, 2024 that may be closed by this pull request
5 tasks
@Luna-Klatzer Luna-Klatzer changed the base branch from main to dev-next July 22, 2024 14:51
Copy link

codecov bot commented Jul 22, 2024

Codecov Report

Attention: Patch coverage is 94.11765% with 3 lines in your changes missing coverage. Please review.

Project coverage is 84.00%. Comparing base (5e0ecc5) to head (41f9b6a).

Files Patch % Lines
...rc/compiler/semantics/analyser/semantic-checker.ts 60.00% 1 Missing and 1 partial ⚠️
...re/src/compiler/semantics/analyser/type-checker.ts 88.88% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           dev-next     #677      +/-   ##
============================================
+ Coverage     83.98%   84.00%   +0.02%     
============================================
  Files           270      270              
  Lines          4502     4514      +12     
  Branches        479      481       +2     
============================================
+ Hits           3781     3792      +11     
- Misses          582      583       +1     
  Partials        139      139              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Luna-Klatzer Luna-Klatzer marked this pull request as ready for review July 22, 2024 14:55
@Luna-Klatzer Luna-Klatzer force-pushed the 669-feature-implement-assignment-to-arrays-based-on-index branch from 41f9b6a to 480a2c4 Compare July 24, 2024 09:21
@Luna-Klatzer Luna-Klatzer merged commit 94aa36d into dev-next Jul 24, 2024
23 checks passed
@Luna-Klatzer Luna-Klatzer deleted the 669-feature-implement-assignment-to-arrays-based-on-index branch July 24, 2024 09:25
@Luna-Klatzer Luna-Klatzer mentioned this pull request Sep 18, 2024
39 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or enhancement
Projects
Development

Successfully merging this pull request may close these issues.

[Feature] Implement assignment to arrays based on index
1 participant