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

Parse doc comments on mapping clauses #341

Merged
merged 1 commit into from
Oct 2, 2023
Merged

Parse doc comments on mapping clauses #341

merged 1 commit into from
Oct 2, 2023

Conversation

Alasdair
Copy link
Collaborator

@Alasdair Alasdair commented Oct 2, 2023

Allows round-tripping mapping doc comments through the pretty-printer

Previously, some doc comments would be silently stripped by descattering as there is nowhere for them to go. While this patch and previous ones address some of these issues there are still a few places where this is unavoidable, so warn when that occurs.

Adjust the syntax of doc comments slightly to address formatting issues:

  • Nested comments are now preserved in the documentation string

  • We allow doc comments to be written with leading asterisks, i.e.

    /*!
     * Some doc comment
     * with leading asterisks
     */
    

    These asterisks (and a space on each side) will be stripped out, so the above is equivalent to:

    /*!
    Some doc comment
    with leading asterisks
    */
    

    In order for an asterisk to be recognized, it must now be preceded
    by a newline, then 1 or more whitespace characters, and followed by exactly 1
    whitespace character, before the comment continues. This sequence will
    be replaced by a newline followed by the whitespace with the final
    " * " sequence removed.

    Previously it was 0 or more whitespace characters before the asterisk,
    and the whitespace after was optional.

@github-actions
Copy link

github-actions bot commented Oct 2, 2023

Test Results

       8 files  ±0       19 suites  ±0   0s ⏱️ ±0s
   549 tests +1     549 ✔️ +1  0 💤 ±0  0 ±0 
1 828 runs  +3  1 827 ✔️ +3  1 💤 ±0  0 ±0 

Results for commit 38b7db6. ± Comparison against base commit 6b47fd2.

♻️ This comment has been updated with latest results.

Allows round-tripping mapping doc comments through the pretty-printer

Previously, some doc comments would be silently stripped by descattering
as there is nowhere for them to go. While this patch and previous ones
address some of these issues there are still a few places where this is
unavoidable, so warn when that occurs.

Adjust the syntax of doc comments slightly to address formatting issues:

* Nested comments are now preserved in the documentation string

* We allow doc comments to be written with leading asterisks, i.e.

  /*!
   * Some doc comment
   * with leading asterisks
   */

  These asterisks (and a space on each side)  will be stripped out, so the above is equivalent to:

  /*!
  Some doc comment
  with leading asterisks
  */

  In order for an asterisk to be recognized, it must now be preceded
  by a newline, then 1 or more whitespace characters, and followed by exactly 1
  whitespace character, before the comment continues. This sequence will
  be replaced by a newline followed by the whitespace with the final
  " * " sequence removed.

  Previously it was 0 or more whitespace characters before the asterisk,
  and the whitespace after was optional.
@Alasdair Alasdair merged commit 6ef3988 into sail2 Oct 2, 2023
9 checks passed
@Alasdair Alasdair deleted the mapping_doc branch October 2, 2023 17:54
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.

1 participant