Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions org.eclipse.jdt.core.compiler.batch/grammar/java.g
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ $Terminals
BeginCasePattern
RestrictedIdentifierWhen
UNDERSCORE
RestrictedIdentifiervalue

-- BodyMarker

Expand Down Expand Up @@ -230,6 +231,8 @@ Goal ::= RestrictedIdentifierpermits PermittedTypes
-- jsr 427 --
Goal ::= BeginCasePattern Pattern
Goal ::= RestrictedIdentifierWhen Expression
-- JEP 401 Value Objects and Classes Disambiguation
Goal ::= RestrictedIdentifiervalue Modifiersopt
/:$readableName Goal:/

Literal -> IntegerLiteral
Expand Down Expand Up @@ -680,6 +683,7 @@ Modifier -> 'transient'
Modifier -> 'volatile'
Modifier -> 'strictfp'
Modifier ::= Annotation
Modifier -> RestrictedIdentifiervalue
/.$putCase consumeAnnotationAsModifier(); $break ./
/:$readableName Modifier:/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public interface ClassFileConstants {
* Other VM flags.
*/
int AccSuper = 0x0020;
int AccIdentity = 0x0020;

/**
* Extra flags for types and members attributes (not from the JVMS, should have been defined in ExtraCompilerModifiers).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ public enum JavaFeature {
Messages.bind(Messages.markdown_comments),
CharOperation.NO_CHAR_CHAR,
false),
VALUE_CLASSES_AND_OBJECTS(ClassFileConstants.JDK26,
Messages.bind(Messages.primitives_in_patterns),
new char[][] {TypeConstants.VALUE_RESTRICTED_KEYWORD},
true),
;

final long compliance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
* Stephan Herrmann <stephan@cs.tu-berlin.de> - Contributions for
Expand Down Expand Up @@ -36,6 +40,7 @@ public interface ExtraCompilerModifiers { // modifier constant
final int AccRestrictedAccess = ASTNode.Bit19;
final int AccFromClassFile = ASTNode.Bit20;
final int AccDefaultAbstract = ASTNode.Bit20;
final int AccValue = ASTNode.Bit20; // class that is a value class (ref ACC_IDENTITY of JVM)
// bit21 - use by ClassFileConstants.AccDeprecated
// bit22 was used for AccDeprecatedImplicitly
final int AccAlternateModifierProblem = ASTNode.Bit23;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
* Stephan Herrmann - Contributions for
Expand Down Expand Up @@ -134,6 +138,7 @@ public interface TypeConstants {
char[] NON_SEALED = "non-sealed".toCharArray(); //$NON-NLS-1$
String KEYWORD_EXTENDS = "extends"; //$NON-NLS-1$
String IMPLEMENTS = "implements"; //$NON-NLS-1$
char[] VALUE_RESTRICTED_KEYWORD = "value".toCharArray(); //$NON-NLS-1$

// jsr308
char[] TYPE_USE_TARGET = "TYPE_USE".toCharArray(); //$NON-NLS-1$
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2000, 2024 IBM Corporation and others.
# Copyright (c) 2000, 2025 IBM Corporation and others.
#
# This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -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
###############################################################################
Expand Down Expand Up @@ -80,4 +84,4 @@ compact_source_and_instance_main_methods = Compact Source Files and Instance Mai
flexible_constructor_bodies = Flexible Constructor Bodies
primitives_in_patterns = Primitives In Patterns
module_imports = Module Import Declarations

value_classes_and_objects = Value Classes and Objects
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2024 IBM Corporation and others.
* Copyright (c) 2000, 2025 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -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
*******************************************************************************/
Expand Down Expand Up @@ -1345,6 +1349,7 @@ protected Object parseQualifiedName(boolean reset, boolean allowModule) throws I
case TokenNameprotected:
case TokenNamepublic:
case TokenNameRestrictedIdentifiersealed:
case TokenNameRestrictedIdentifiervalue:
case TokenNameshort:
case TokenNamestatic:
case TokenNamestrictfp:
Expand Down
Loading