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-5302] Swift REPL rejects multiline string literal #4628

Open
swift-ci opened this issue Jun 24, 2017 · 2 comments
Open

[SR-5302] Swift REPL rejects multiline string literal #4628

swift-ci opened this issue Jun 24, 2017 · 2 comments
Labels
bug Something isn't working LLDB for Swift REPL

Comments

@swift-ci
Copy link

Previous ID SR-5302
Radar None
Original Reporter gwk (JIRA User)
Type Bug
Environment

Xcode 9b1, OSX10.12.5.
Xcode 9.2, macOS 10.13.2

Additional Detail from JIRA
Votes 2
Component/s LLDB for Swift
Labels Bug, REPL
Assignee None
Priority Medium

md5: f385f79678eab7118aa36b7e040da9ac

is duplicated by:

  • SR-11215 REPL doesn't understand multiline raw string literals

Issue Description:

$ swift
Welcome to Apple Swift version 4.0 (swiftlang-900.0.43 clang-900.0.22.8). Type :help for assistance.
  1> let s = """
error: repl.swift:1:9: error: unterminated string literal
let s = """
        ^

The REPL knows how to handle multiline array literals, so it ought to be able to handle unterminated triple quotes as well.

@swift-ci
Copy link
Author

Comment by Weicheng Tao (JIRA)

Yes, if you press return right after the """, you will get exactly the same error message. But Swift REPL allows you to press down arrow when you enter the code. This code below should work for you.

let s = """(press down arrow)
this is the first line(press down arrow)
this is the second line(press down arrow)
"""(press return)

@lilyball
Copy link
Mannequin

lilyball mannequin commented Jul 30, 2019

In Swift 5.0.1 the REPL seems to understand multiline string literals just fine, but raw multiline string literals are still broken.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 7, 2022
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 Something isn't working LLDB for Swift REPL
Projects
None yet
Development

No branches or pull requests

1 participant