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

Handle multiline comments in Package (ipkg) #3386

Merged
merged 2 commits into from
Sep 24, 2024

Conversation

stephen-smith
Copy link
Contributor

Description

Alternative to #3384.

Implements multiline comments in ipkg to fulfill the promises of the existing documentation.

Should this change go in the CHANGELOG?

Added to _NEXT.

  • If this is a fix, user-facing change, a compiler change, or a new paper
    implementation, I have updated CHANGELOG_NEXT.md (and potentially also
    CONTRIBUTORS.md).

@stephen-smith
Copy link
Contributor Author

stephen-smith commented Sep 15, 2024

Is CONTRIBUTORS supposed to be maintained in alphabetical (or some other) order?

@CodingCellist
Copy link
Collaborator

Is CONTRIBUTORS supposed to be maintained in alphabetical (or some other) order?

It is meant to be in alphabetical order, yes (or at least, we try)

@@ -99,6 +99,7 @@ andop = is '&' <+> is '&'
rawTokens : TokenMap Token
rawTokens =
[ (comment, Comment . drop 2)
, (blockComment, Comment . shrink 2)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I suppose this lacks a small amount of fidelity since the only useful meaning of the string within the comment would probably account for the fact that a block comment can start with a bracket followed by any number of dashes, but seeing as how 2 characters is the minimum at the start and end that doesn't feel too critical.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since we neither require a matching dash count on the end-of-comment token, nor strip excess leading dashes from eol comments, I don't feel this needs to change.

Parser/Lexer/Source.idr doesn't drop OR shrink for comments (of either type), but it also doesn't attempt to preserve their content in the tokens.

@mattpolzin mattpolzin merged commit 0e83d6c into idris-lang:main Sep 24, 2024
22 checks passed
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.

3 participants