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

Add support for interfaces #95

Merged
merged 2 commits into from
Aug 28, 2024
Merged

Conversation

jabraham17
Copy link
Member

@jabraham17 jabraham17 commented Aug 27, 2024

Adds support for interface, which will be outputed by chpldoc after chapel-lang/chapel#25825

[Reviewed by @lydia-duncan]

Signed-off-by: Jade Abraham <[email protected]>
Signed-off-by: Jade Abraham <[email protected]>
Copy link
Member

@lydia-duncan lydia-duncan left a comment

Choose a reason for hiding this comment

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

This looks reasonable, but would you post a screenshot of what it looks like to use write an interface with these changes?

@jabraham17
Copy link
Member Author

Yes, so here is my test case from chapel-lang/chapel#25825

/*
  An interface without formals
*/
interface myInterface {
  /* The foo method */
  proc Self.foo();
  @deprecated("bar is deprecated")
  proc Self.bar();
}

/*
  An interface with formals
*/
@unstable("I am unstable")
interface myInterfaceWithFormals(T1, T2) {
  proc Self.foo(x: T1);
  /* The bar method */
  proc Self.bar(y: T2);
  @chpldoc.nodoc
  proc Self.hidden();
}

@chpldoc.nodoc
interface hiddenInterface {
  proc Self.hidden();
}

Screenshot 2024-08-28 at 8 41 04 AM

@lydia-duncan
Copy link
Member

Awesome, thanks!

@jabraham17 jabraham17 merged commit 5a2bc62 into chapel-lang:main Aug 28, 2024
1 check passed
@jabraham17 jabraham17 deleted the add-interfaces branch August 28, 2024 15:56
jabraham17 added a commit to chapel-lang/chapel that referenced this pull request Aug 28, 2024
Adds compiler support for interfaces to have attributes applied to them
and have docstrings recognized by chpldoc

Resolves #17383

Relies on
chapel-lang/sphinxcontrib-chapeldomain#95

This PR also updates the interface `Allocators.allocator`.
#25821 will update the
existing Sort module allocators. No other allocators are currently shown
in our documentation

While adding tests of `@unstable` with interfaces, I found that some
tests weren't actually testing what we thought they were (i.e.
`test/unstable-keyword/enum_test1.chpl`), so I updated them

Testing
- [x] full paratest with/without comm

[Reviewed by @lydia-duncan and @DanilaFe]
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.

2 participants