diff options
author | Jay Arthanareeswaran | 2019-07-05 03:41:33 +0000 |
---|---|---|
committer | Jay Arthanareeswaran | 2019-07-05 08:56:51 +0000 |
commit | ba38cbc42b824a26720727ec32191753fe9e726b (patch) | |
tree | 4a358c77bb4d35c87aa4f5707676c76d4be12090 | |
parent | c8c50fda37478e301752a46f07714e43c4504896 (diff) | |
download | eclipse.jdt.core-ba38cbc42b824a26720727ec32191753fe9e726b.tar.gz eclipse.jdt.core-ba38cbc42b824a26720727ec32191753fe9e726b.tar.xz eclipse.jdt.core-ba38cbc42b824a26720727ec32191753fe9e726b.zip |
Leverage the preview option to turn on preview features in reconciler
Change-Id: I2c063984232ccbe3545a57c1d6ec282648b63fa9
7 files changed, 26 insertions, 16 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java index 4b015dc3b7..bfa912989a 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java @@ -184,6 +184,11 @@ public static Test suite() { since_12.add(SwitchExpressionTest.class); since_12.add(Unicode11Test.class); + // add 13 specific test here (check duplicates) + ArrayList since_13 = new ArrayList(); + since_13.add(SwitchExpressionsYieldTest.class); + since_13.add(Unicode12_1Test.class); + // Build final test suite TestSuite all = new TestSuite(TestAll.class.getName()); all.addTest(new TestSuite(StandAloneASTParserTest.class)); @@ -306,6 +311,7 @@ public static Test suite() { tests_13.addAll(since_10); tests_13.addAll(since_11); tests_13.addAll(since_12); + tests_13.addAll(since_13); TestCase.resetForgottenFilters(tests_13); all.addTest(AbstractCompilerTest.buildComplianceTestSuite(ClassFileConstants.getComplianceLevelForJavaVersion(ClassFileConstants.MAJOR_VERSION_13), tests_13)); } diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ConflictedParser.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ConflictedParser.java index fa78ce03c0..b4b1ad2e9c 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ConflictedParser.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/ConflictedParser.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2019 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -7,6 +7,10 @@ * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 + * + * This is an implementation of an early-draft specification developed under the Java + * Community Process (JCP) and is made available for testing and evaluation purposes + * only. The code is not compatible with any specification of the JCP. * * Contributors: * IBM Corporation - initial API and implementation @@ -27,5 +31,4 @@ public interface ConflictedParser { * appear as terminals in ModuleDeclaration, and are identifiers everywhere else) */ boolean isParsingModuleDeclaration(); - boolean isParsingJava13(); } diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java index a6f1c64541..0e35546650 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java @@ -979,7 +979,6 @@ public Parser(ProblemReporter problemReporter, boolean optimizeStringLiterals) { this.parsingJava13Plus = this.options.sourceLevel >= ClassFileConstants.JDK13; this.parsingJava12Plus = this.options.sourceLevel >= ClassFileConstants.JDK12; this.parsingJava11Plus = this.options.sourceLevel >= ClassFileConstants.JDK11; - this.parsingJava13Plus = this.options.sourceLevel >= ClassFileConstants.JDK13; this.astLengthStack = new int[50]; this.expressionLengthStack = new int[30]; this.typeAnnotationLengthStack = new int[30]; @@ -11912,10 +11911,6 @@ public boolean atConflictScenario(int token) { return automatonWillShift(token, this.unstackedAct); } -@Override -public boolean isParsingJava13() { - return this.parsingJava13Plus; -} /*main loop of the automat When a rule is reduced, the method consumeRule(int) is called with the number of the consumed rule. When a terminal is consumed, the method consumeToken(int) is diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java index 02526cf793..19c177b018 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Scanner.java @@ -555,8 +555,9 @@ public char[] getCurrentTokenSourceString() { return result; } protected final boolean scanForTextBlockBeginning() { - if (this.activeParser != null && !this.activeParser.isParsingJava13()) + if (!this.previewEnabled) { return false; + } try { // Don't change the position and current character unless we are certain // to be dealing with a text block. For producing all errors like before diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser.java index a17139eba5..ca89a8527b 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2019 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -8,6 +8,10 @@ * * SPDX-License-Identifier: EPL-2.0 * + * This is an implementation of an early-draft specification developed under the Java + * Community Process (JCP) and is made available for testing and evaluation purposes + * only. The code is not compatible with any specification of the JCP. + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -2568,9 +2572,4 @@ public class DiagnoseParser implements ParserBasicInformation, TerminalTokens, C // return this.parser.isParsingModuleDeclaration(); } - - @Override - public boolean isParsingJava13() { - return this.parser.isParsingJava13(); - } } diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/CommentRecorderParser.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/CommentRecorderParser.java index 48f9140974..cfed95785b 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/CommentRecorderParser.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/CommentRecorderParser.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. + * Copyright (c) 2000, 2019 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -8,6 +8,10 @@ * * SPDX-License-Identifier: EPL-2.0 * + * This is an implementation of an early-draft specification developed under the Java + * Community Process (JCP) and is made available for testing and evaluation purposes + * only. The code is not compatible with any specification of the JCP. + * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ @@ -274,6 +278,7 @@ public class CommentRecorderParser extends Parser { this.options.taskTags/*taskTags*/, this.options.taskPriorities/*taskPriorities*/, this.options.isTaskCaseSensitive/*taskCaseSensitive*/); + this.scanner.previewEnabled = this.options.enablePreviewFeatures; } /* @@ -26,6 +26,8 @@ <properties> <tycho.scmUrl>scm:git:git://git.eclipse.org/gitroot/jdt/eclipse.jdt.core.git</tycho.scmUrl> + <eclipserun-repo>https://download.eclipse.org/eclipse/updates/4.13-Y-builds/</eclipserun-repo> + <cbi-ecj-version>3.18.50.v20190628-1803</cbi-ecj-version> </properties> <!-- @@ -68,7 +70,6 @@ <module>org.eclipse.jdt.apt.pluggable.tests</module> <module>org.eclipse.jdt.apt.tests</module> <module>org.eclipse.jdt.compiler.apt.tests</module> - <module>org.eclipse.jdt.tests.latestBREE</module> </modules> <build> |