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

[SR-10440] REPL: extended delimiter multi-line string doesn't work #52840

Closed
swift-ci opened this issue Apr 10, 2019 · 4 comments · Fixed by #63368
Closed

[SR-10440] REPL: extended delimiter multi-line string doesn't work #52840

swift-ci opened this issue Apr 10, 2019 · 4 comments · Fixed by #63368
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-10440
Radar rdar://problem/49835715
Original Reporter chriseidhof (JIRA User)
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: c0f63a7f04231f79dbf796d6a8638fbe

Issue Description:

In the Swift REPL, we can use multi-line strings (using `"""`), but we can't use the delimiter syntax (e.g. `#"""`). I expected to be able to type:

let x = #"""

But when I press Enter, the REPL complains:

error: unterminated string literal

@belkadan
Copy link
Contributor

Oh, did we fix the original SR-5302? jingham@apple.com (JIRA User), do you know who fixed that?

@swift-ci
Copy link
Collaborator Author

Comment by Jim Ingham (JIRA)

When you hit a return, lldb takes the current expression text and passes it to

swift::ide::isSourceInputComplete

If that returns true, we submit the expression to be parsed & executed, if it returns false we let you add another line to the current expression. Sounds like that was fixed to understand """ but not #""".

@swift-ci
Copy link
Collaborator Author

Comment by Jim Ingham (JIRA)

I switched this over to the compiler (though maybe swift::ide is SourceKit, I'm not sure...) We are just getting the wrong answer back from isSourceInputComplete.

@belkadan
Copy link
Contributor

You're welcome to fix things in the compiler repo too! :-)

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
poya added a commit to poya/swift that referenced this issue Feb 2, 2023
Extend solution marking incomplete multi-line string literals as
incomplete during input in REPL to also cover raw multi-line strings.

Fixes apple#52840
poya added a commit to poya/swift that referenced this issue Feb 2, 2023
Extend handling of incomplete multi-line string literals during input in
REPL to also cover raw multi-line strings.

Fixes apple#52840 and apple/llvm-project#4628
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants