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

Spurious unclosed string literal warning in Repl #6659

Closed
scabug opened this issue Nov 13, 2012 · 5 comments

Comments

@scabug
Copy link

commented Nov 13, 2012

Tab completion works fine on a string literal:

Welcome to Scala version 2.10.0-RC2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_37).
Type in expressions to have them evaluated.
Type :help for more information.

scala> "foo".s
split         startsWith    subSequence   substring     

But if the string contains a comma:

scala> "foo,bar".s<console>:1: error: unclosed string literal
bar"
   ^
@scabug

This comment has been minimized.

Copy link
Author

commented Nov 13, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6659?orig=1
Reporter: @paulbutcher
Affected Versions: 2.10.0-RC2
Duplicates #4438

@scabug

This comment has been minimized.

Copy link
Author

commented Jul 1, 2013

@som-snytt said:
scala.repl.debug=true shows the completer receives bar" to complete, with the line split on the comma, so when converting that to something it can type, it errors out.

It looks like the parsing is done on the scala side of jline, and maybe this comment is relevant:

def isQuoted = false // TODO
@scabug

This comment has been minimized.

Copy link
Author

commented Aug 18, 2013

@retronym said:
Another example from #7762.

 ~/code/scala scala-hash v2.11.0-M4 -nc
[info] v2.11.0-M4 => /Users/jason/usr/scala-v2.11.0-M4-0-g8b41240
Welcome to Scala version 2.11.0-20130710-171554-8b41240f3d (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_37).
Type in expressions to have them evaluated.
Type :help for more information.

scala> "99.4".toD<console>:1: error: unclosed string literal
"99
^
@scabug

This comment has been minimized.

Copy link
Author

commented Apr 19, 2015

Li Haoyi (lihaoyi) said:
This has been fixed in the Ammonite REPL.

@ "foo".s
sameElements    scan            scanLeft        scanRight       segmentLength   self
seq             size            slice           sliding         sortBy          sortWith
sorted          span            split           splitAt         startsWith      stringPrefix
stripLineEnd    stripMargin     stripPrefix     stripSuffix     subSequence     substring
sum             synchronized
@ "foo,bar".s
sameElements    scan            scanLeft        scanRight       segmentLength   self
seq             size            slice           sliding         sortBy          sortWith
sorted          span            split           splitAt         startsWith      stringPrefix
stripLineEnd    stripMargin     stripPrefix     stripSuffix     subSequence     substring
sum             synchronized
@ "foo,bar".s
@scabug

This comment has been minimized.

Copy link
Author

commented Apr 19, 2015

@som-snytt said:
Does Ammonite do column output, column-first instead of row-first? Funny how I can't go back. The other question is whether the JLine dependency is useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.