Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
8241741: Implement Text Blocks as a standard feature in javac
Reviewed-by: jlahoda
- Loading branch information
Showing
with
69 additions
and 44 deletions.
- +1 −1 src/java.base/share/classes/jdk/internal/PreviewFeature.java
- +0 −1 src/jdk.compiler/share/classes/com/sun/tools/javac/code/Preview.java
- +23 −21 src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java
- +5 −6 test/langtools/tools/javac/TextBlockAPI.java
- +1 −1 test/langtools/tools/javac/TextBlockIllegalEscape.java
- +0 −2 test/langtools/tools/javac/TextBlockIllegalEscape.out
- +2 −2 test/langtools/tools/javac/TextBlockLang.java
- +0 −3 test/langtools/tools/javac/diags/examples/TextBlockCloseDelimiter.java
- +1 −4 test/langtools/tools/javac/diags/examples/TextBlockOpenDelimiter.java
- +35 −0 test/langtools/tools/javac/diags/examples/TextBlockSource.java
- +1 −3 test/langtools/tools/javac/diags/examples/TextBlockWhitespace.java
@@ -1,4 +1,2 @@ | ||
TextBlockIllegalEscape.java:11:13: compiler.err.illegal.esc.char | ||
- compiler.note.preview.filename: TextBlockIllegalEscape.java | ||
- compiler.note.preview.recompile | ||
1 error |
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. | ||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
* | ||
* This code is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License version 2 only, as | ||
* published by the Free Software Foundation. | ||
* | ||
* This code is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* version 2 for more details (a copy is included in the LICENSE file that | ||
* accompanied this code). | ||
* | ||
* You should have received a copy of the GNU General Public License version | ||
* 2 along with this work; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
* | ||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
* or visit www.oracle.com if you need additional information or have any | ||
* questions. | ||
*/ | ||
|
||
// key: compiler.misc.feature.text.blocks | ||
// key: compiler.err.feature.not.supported.in.source.plural | ||
// key: compiler.warn.source.no.system.modules.path | ||
// options: -source 14 | ||
|
||
class TextBlockSource { | ||
String m() { | ||
return """ | ||
abc | ||
"""; | ||
} | ||
} |