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 struct types #207

Merged
merged 10 commits into from
May 15, 2024
Merged

feat: Add struct types #207

merged 10 commits into from
May 15, 2024

Conversation

mark-koch
Copy link
Collaborator

@mark-koch mark-koch commented May 13, 2024

This PR adds struct definitions to the language. Closes #159 and closes #161.

Parsing, checking and tests are added in the following PRs:

Copy link
Collaborator

@aborgna-q aborgna-q left a comment

Choose a reason for hiding this comment

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

Really nice!

Base automatically changed from chore/inst-globals to main May 13, 2024 14:28
mark-koch and others added 4 commits May 15, 2024 10:53
Parses struct definitions of the following form:

```
class MyStruct:
   field1: SomeType
   field2: OtherType
   ...
```

As a drive-by this PR also fixes the source location annotation for
types in string form
@codecov-commenter
Copy link

codecov-commenter commented May 15, 2024

Codecov Report

Attention: Patch coverage is 96.20853% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 90.97%. Comparing base (af4fb07) to head (b89fcec).

Files Patch % Lines
guppylang/definition/struct.py 97.01% 4 Missing ⚠️
guppylang/tys/ty.py 90.00% 2 Missing ⚠️
guppylang/checker/core.py 50.00% 1 Missing ⚠️
guppylang/tys/param.py 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #207      +/-   ##
==========================================
+ Coverage   90.70%   90.97%   +0.26%     
==========================================
  Files          46       47       +1     
  Lines        4789     4975     +186     
==========================================
+ Hits         4344     4526     +182     
- Misses        445      449       +4     

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

@mark-koch mark-koch merged commit f7adb85 into main May 15, 2024
3 checks passed
@mark-koch mark-koch deleted the feat/structs branch May 15, 2024 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parse struct definitions Add StructDef and StructType
3 participants