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: string gaps for continuing string literals across multiple lines #2821

Merged
merged 3 commits into from
Dec 7, 2023

Conversation

kmill
Copy link
Collaborator

@kmill kmill commented Nov 5, 2023

Implements "gaps" in string literals. These are escape sequences of the form "\" newline whitespace+ that have the interpretation of an empty string. For example,

  "this is \
     a string"

is equivalent to "this is a string". These are modeled after string continuations in Rust.

Implements RFC #2838

@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Nov 5, 2023
Copy link
Contributor

github-actions bot commented Nov 5, 2023

  • ❗ Mathlib CI will not be attempted unless you rebase your PR onto the 'nightly' branch. (2023-11-05 04:27:11)
  • ❗ Mathlib CI can not be attempted yet, as the 'nightly-testing-2023-11-05' branch does not exist there yet. We will retry when you push more commits. It may be necessary to rebase onto 'nightly' tomorrow. (2023-11-05 08:43:05)

@kmill kmill force-pushed the string_gaps branch 2 times, most recently from a17303d to d62eb06 Compare November 7, 2023 07:27
@kmill kmill changed the title feat: string gaps for splitting string literals across multiple strings feat: string gaps for continuing string literals across multiple lines Nov 7, 2023
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Nov 7, 2023
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Nov 7, 2023
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Nov 19, 2023
@kmill kmill marked this pull request as ready for review November 19, 2023 06:50
@kmill kmill added the awaiting-review Waiting for someone to review the PR label Nov 19, 2023
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Nov 19, 2023
@leanprover-community-mathlib4-bot
Copy link
Collaborator

leanprover-community-mathlib4-bot commented Nov 19, 2023

src/Init/Meta.lean Outdated Show resolved Hide resolved
src/Lean/Parser/Basic.lean Outdated Show resolved Hide resolved
tests/lean/string_gaps.lean Outdated Show resolved Hide resolved
Implements RFC lean4#2838

For example,
```
  "this is \
     a string"
```
is equivalent to "this is a string".
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Dec 5, 2023
@kmill kmill requested a review from Kha December 6, 2023 01:22
@Kha
Copy link
Member

Kha commented Dec 6, 2023

Perfect test docs! I think all we're missing now is a changelog entry

@kmill
Copy link
Collaborator Author

kmill commented Dec 6, 2023

@Kha What are you looking for with the changelog entry? Do you mean I should write something in RELEASES.md for the development version?

By the way, once the string literal PRs are all sorted out, I can write a rough draft of the strings section of the reference manual.

@Kha
Copy link
Member

Kha commented Dec 6, 2023

Do you mean I should write something in RELEASES.md for the development version?

Yes, a brief sentence similar to the PR title and a PR link are sufficent.

By the way, once the string literal PRs are all sorted out, I can write a rough draft of the strings section of the reference manual.

Great! You should probably get in touch with @david-christiansen for that.

@david-christiansen
Copy link
Contributor

Until the reference manual project gets really underway early next year, I'm encouraging people to document what they're doing thoroughly, but with the understanding that it'll be substantially revised while integrating with the rest of the text. Any format is fine. Thanks!

@kmill kmill requested a review from kim-em as a code owner December 7, 2023 05:06
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Dec 7, 2023
@Kha Kha added this pull request to the merge queue Dec 7, 2023
Merged via the queue into leanprover:master with commit bcbcf50 Dec 7, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review Waiting for someone to review the PR builds-mathlib CI has verified that Mathlib builds against this PR toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants