Skip to content

Instantly share code, notes, and snippets.

@headius
Created January 14, 2014 07:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save headius/8414655 to your computer and use it in GitHub Desktop.
Save headius/8414655 to your computer and use it in GitHub Desktop.
It's so hard to add multiline strings to Java!
diff -r 4830d661c4f9 src/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java
--- a/src/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java Thu May 23 10:47:57 2013 -0700
+++ b/src/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java Tue Jan 14 01:46:41 2014 -0600
@@ -637,7 +637,7 @@
break loop;
case '\"':
reader.scanChar();
- while (reader.ch != '\"' && reader.ch != CR && reader.ch != LF && reader.bp < reader.buflen)
+ while (reader.ch != '\"' && reader.bp < reader.buflen)
scanLitChar(pos);
if (reader.ch == '\"') {
tk = TokenKind.STRINGLITERAL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment